How to remove public from Laravel URL

In this post, I will tell you how to remove public from URL in Laravel. Such as Suppose your URL is http://localhost/yourproject/public  But you don’t want to write each time public to access a URL That’s mean you want your URL like http://localhost/yourproject/ .Although you can also remove public while deploying your project in your live host. But I will show you how you can remove public from Laravel URL in localhost. Following the steps of how to do that.

Remove Public From Laravel URL

 

Steps of removing Public from Laravel URL

  1. Go to mainproject/public 

a. .htacess

b. favicon.ico

c. index.php

d. robots.txt

e. web.config

  1. Cut these Above 5 files from the public folder, and then paste on the main project folder that means outside of public folder.mainproject/files
  2. Next after paste, open index.php , modify

to

 

  1. Modify

 

 

to

 

Youtube link: https://youtu.be/GboCYqEbKN0

For Video

 

Share with:


Comments are closed.