This article will guide you through the process of configuring your Laravel application so that the public folder is accessed immediately upon entering your domain name.
Should you have set up Laravel within the public_html directory, which is the root directory for your main domain on the account, yet prefer that your visitors not be directed to the standard domain.com/public URL, please proceed with the following instructions:
Search for .htaccess files within the public_html directory, or the main folder for your domain. Typically, dotfiles like these are not visible in your File Manager. To see all dotfiles, such as the .htaccess file, you will need to take certain steps. Should the .htaccess file continue to elude you, proceed to generate a new file using File Manager and name it .htaccess.
After you open the .htaccess file, add the following code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Click to save your changes. After this, you and your visitors should be able to access your Laravel public folder via domain.com. Keep in mind that you might have to clear your browser cache