Steps to remove /public from Laravel URL

kumkumsharma

Administrator
Staff member
If you want to use laravel directly with its domain name then you have to check below steps:
  • For security reason you have to take backup of your .htaccess file with below command:
Code:
cp -vi .htaccess{,.bak}
  • Now you have to add below code in your .htaccess file.
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
Now save your .htaccess file and you can access your website https://domain.com.
 
Top