Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel 5.1 route direct to public folder

this is my route to access index.php ....http://localhost/abc/public/ if i write http://localhost/abc/ it does pick public bydefault

i want to write .htaccess file to direct http://localhost/abc call to http://localhost/abc/public/ so my url will not hurt..

in short i want http://localhost/abc/ and by dont even change directory struture of laravel.

like image 781
Bakhtawar GIll Avatar asked Dec 18 '25 05:12

Bakhtawar GIll


1 Answers

To remove public from url you can try this..

Important: Add following code in your .htaccess (if not exist create a .htaccess on laravel root directory)

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]

You can see this link for more help..

Hope this will work.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!