What I did in the past with Apache:
Put an .htaccess file in the root with:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
And put one in the public folder that is just default
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
If possible change the vhost setting to go to /path/to/laravel/public
instead of /path/to/laravel
Thanks, by far the best solution, or at least the only one that works well, now i only need to create an exception for a folder inside web root:
www.mywebsite.it/exceptionfolder/... should remains www.mywebsite.it/exceptionfolder/...
longilineo said:
Thanks, by far the best solution, or at least the only one that works well, now i only need to create an exception for a folder inside web root:
www.mywebsite.it/exceptionfolder/... should remains www.mywebsite.it/exceptionfolder/...
RewriteCond %{REQUEST_FILENAME} !-d
should take care of that
www.mywebsite.it/exceptionfolder/ isn't a route
in my project web root i've
With that rewrite conditions, if i try to reach
http://www.mywebsite.it/exceptionfolder I get too many redirects error
while reaching http://www.mywebsite.it/exceptionfolder/anythingelse i get NotFoundHttpException
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community