For Laravel 5:
Follow steps below to remove "public" word from URL,
1) Rename the server.php in the your Laravel root folder to index.php
2) Copy .htaccess file from /public directory to your Laravel root folder.
3) Changing .htaccess file as follows for statics:
If there are any other static files needed just add the extension to the previous declared list
And now its done!!!
Follow steps below to remove "public" word from URL,
1) Rename the server.php in the your Laravel root folder to index.php
2) Copy .htaccess file from /public directory to your Laravel root folder.
3) Changing .htaccess file as follows for statics:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
If there are any other static files needed just add the extension to the previous declared list
And now its done!!!
Wonderful blog! Thanks for sharing the information on the blog. Magento Development Companies in Bangalore
ReplyDeleteI simply wanted to thank you so much again. I am not sure the things that I might have gone through without the type of hints revealed by you regarding that situation. Hire laravel developers UK
ReplyDeleteGreat Article so thanks for sharing your article it will be helpful for me please check here hire laravel developer | full stack web developer
ReplyDelete