I have a Laravel installation on DigitalOcean through CloudWays in which one of the routes doesn't work. It has nginx serving static content and Apache serving the dynamic pages. Every route works fine, except for the following one:
Route::get('/r/{id}/{url}', 'CampaignController@redirect')
->where('url', '(.*)?');
On my localhost through php artisan serve
, it works and on another installation on nginx it works fine. This is a client's server and although he has granted my account full access to the server, sudo
is disabled and I can't touch anything outside of the public_html
directory, so I'm assuming it's doable through .htaccess
, here's what I have now:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
</IfModule>
# For all files not found in the file system, reroute the request to the
# "index.php" front controller, keeping the query string intact
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>