Unable to remove public from the url in shared cpanel hosting.
-
Hi,
I've created a project at https://example.com/bagisto/
in the /bagisto/.htaccess and /bagisto/public/.htaccess I added the below snippet<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule>
but still, the public folder is showing in the URL as https://example.com/bagisto/public instead https://example.com/bagisto/
Am I missing anything?
-
Hello @Sachin-0
To know in detail about how to redirect the public to the main domain you can through the below video.
Link - https://www.youtube.com/watch?v=OoUQQMu_ArU&t=10s
Thanks & Regards
-
This works fine in localhost and while developing but the issue came when I was updated in my cpanel hosting. I've installed it through the Softaculous installer in Cpanel.
I have attempted to use several .htaccess rules including the default one for Laravel that sends requests to 'public'. Unfortunately, it resulted in 403 or 404 errors as well. However, usually, it should work fine.
Therefore, I assume that the '/public' route exists in the code of the application, which causes this error.
it would be great If you could help in any way.
Thanks.