This guide explains how to configure your website so that your Laravel application loads directly from the /public directory when visitors access your domain, without showing /public in the URL.
By default, Laravel’s entry point is the public folder. If Laravel is installed inside your primary domain’s root directory (usually public_html), you can use .htaccess rules to point all traffic to the public directory automatically.
Use this method if:
Laravel is installed in public_html
Your Laravel structure looks like this:
public_html/
├── app
├── bootstrap
├── config
├── public
├── resources
└── routesYou want visitors to access your site via:
https://example.cominstead of:
https://example.com/publicLog in to cPanel.
Open File Manager.

Navigate to your domain’s root directory (public_html).
Enable Show Hidden Files (Dotfiles) from File Manager settings.
Look for a file named .htaccess.
If it does not exist, create a new file and name it .htaccess.

Open the .htaccess file and add the following code:
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]Save the file once done.
Visit your domain in a browser (e.g. https://example.com)
Your Laravel application should now load correctly without /public in the URL
If changes do not appear immediately, clear your browser cache or try an incognito window
Ensure mod_rewrite is enabled on the server (it is enabled by default on most shared hosting).
Make sure the public directory contains Laravel’s index.php.
This setup is recommended only if you cannot change the document root at the server level.
If your site shows errors after applying these changes, or if Laravel still does not load correctly, contact our support team for further guidance.