I tried to make Laravel works on my environment (MAMP) but i'm stuck in this situation.
The index.php
file of Laravel is into a subfolder called "public", so if I want to test my application I need to access it with this url http://localhost/laravel/public/
but I want access with http://localhost/laravel
I tried to set an htaccess with this rows but it doesn't work:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ public/$1
</IfModule>
I'm not sure that this htaccess can resolves this situation, I get a 404 generated by Lavarel.
You need to create a virtualhost. Dayle Ress covers this in the first chapter in his Laravel book: https://web.archive.org/web/20121013083457/http://daylerees.com/2012/03/25/laravel-getting-started/
Put .htacess file in root with code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With