How to redirect all requests to your main domain from the /public folder in Laravel?

In this article, you will learn how to redirect all requests from Laravel public folder to your main domain in Apache. Laravel by default redirects every request to the /public folder, so your wesite is accessible at

After you have installed Laravel in your web root (public_html, web, etc.), look for a .htaccess file in the root directory. Make sure you have enabled the view the hidden files option in your File/FTP manager. If the .htaccess file doesn’t exists, create one.

Open the .htaccess file and add the following code:

Save the file. After these changes, you and your visitors should be able to access your Laravel website at

5 1 vote
Article Rating
Notify of
Inline Feedbacks
View all comments