How can we install shopware 6.5 on shared server and redirect all request to public/ directory

Some of shared hosting provider doesn’t allow to change main document root (e.g. public_html) to any other directory. In this case, How can we install shopware 6.5 on shared server and redirect all request to public/ directory. I have tried below redirect rule on root .htaccess but it’s not working.

RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

I would recommend to look for a different hosting provider.

In your case, it could work if you change the .htaccess of the main directory. But then all your URLs would contain public in the path. It is absolutely not recommended and it could be unsafe!!!