Trick to remove public/index.php from URL in Laravel
Last Modified at 2019-09-19 17:01:40
If you found "public/index.php/" in your project's URLs and you want to remove that then, you will have to create an .htaccess file in your project's root directory and you have to put below code in it and save the .htaccess file. However; you have to make sure that the 'mod_rewrite' module is enabled on your server. If it's not then .htaccess code will not work.
Open your .htaccess file from your Laravel project root directory and place this code and save it.
RewriteRule ^(.*)$ public/$1 [L]
Now, you can access your URLs without "public/index.php".