Basically I need to remove index.php
or public/index.php
from the the generated URL in laravel, commonly path is localhost/public/index.php/someWordForRoute
, It should be something like localhost/someWordForRoute
htacces
<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]
app/config/app.php
'url' => 'http://localhost',
how can I change that?
Don't get confused with other option the snippet below I am using and will be useful for you too. Put the below htacces in your root.
Go to your public directory and put another htaccess file with the code snippet below
Its working... !!!
Laravel Uses below .htaccess
Laravel ships with a pretty URL .htaccess already... you should be good to go out of the box... http://laravel.com/docs/installation#pretty-urls
Make sure mod_rewrite is enabled and that your home path is set to the public directory of your application.