We will learn how to make your Laravel public folder open directly from the root domain.
Open .htaccess file in your public_html (or your domain root folder). If .htaccess doesn’t exist in the public_html folder, Create a new file, named .htaccess.
Add the following code:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Save the file. You should be able to access your Laravel public folder via domain.com.

Author

I am a Laravel developer with some other skills.

Write A Comment