New Feature Announcement: Master Your Email Delivery with the Mail Delivery Center

How do I load Laravel from the /public directory in cPanel

In this article, you will learn how to make your Laravel public folder open directly when you type your domain.

If you have installed Laravel on your primary domain for the account in your public_html folder (root directory for the primary domain), but you do not want your visitors to see the default domain.com/public url, follow these steps:

Look for .htaccess files in your public_html (or your domain root folder). By default, dotfiles are hidden in your File Manager. To view all dotfiles, including .htaccess, follow these steps. If you still cannot find the .htaccess file, create a New File from File Manager, named .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

 
  • 270 Users Found This Useful
Was this answer helpful?

Related Articles

 Connect to your server via SSH

SSH allows secure file transfer and remote logins over the internet. Your connection via SSH is...

 How to force your site to use SSL (HTTPS) using

First of all, you will need to install an SSL certificate to your siteOnce your certificate is...

 How do I change PHP versions, or change my PHP settings / config?

The process of setting your PHP version and the 'variables' (such as memory_limit values) differs...

 How do I install a free SSL via cPanel?

Installing an SSL certificate in cPanel is easy! Best of all, it's free with WebGee!Important:...

 How to send emails in WordPress using the WP SMTP Mail plugin

Instead of using the default PHP mail() function, you can send emails using our SMTP services via...

Powered by WHMCompleteSolution