Because in shared hosting, we can not customize the public folder name. So, we need to remove the public folder from the URL. Laravel has its public folder, and when we host our application on a shared hosting, we can not change the public folder name. So, we need to remove the public folder from the URL.
To remove the public folder from the URL, we need to follow the below steps.
1. Create a .htaccess file in the public folder.
2. Add the below code in the .htaccess file.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]