May 15, 2016

Laravel-5 or 5.2 remove public folder name from the URL


Laravel-5 or 5.2 Remove public folder name from the project URL.

I have configured and installed laravel but now I am facing the issue of URL it will work with the public folder instead of simply end with the project name.
I have written URL as localhost/projectname and my project name is Laraveldemo.

so I can access the URL for the project as localhost/laraveldemo but it's not rendering the view.So I did the R&D how the URL will be in laravel.

I was read the document where written as you can access URL using public directory.so it will be a
localhost/laraveldemo/public.


Now I want to deploy the project to a live server and want to remove the public from the URL.
I did a number of R&D and find the solution as below in just two steps.


1) Rename the server.php in your Laraveldemo root folder to index.php


2) Copy the .htaccess file from /public directory to your project e.x Laraveldemo root folder.



No comments:

Post a Comment