I read this .htaccess rewrite to redirect root URL to subdirectory and i'm trying to achieve the same things.
The solution with most up votes was:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^$ store [L]
Now, looking at the comments it seems to be working good.
The problem is that I'd like not to hardcode any path (as instead provided above "www.example.com"). I'd like that my .htaccess
inside projectname/
redirects to projectname/public/
despite what the real server host is. So that if I put projectname/
inside the root server of www.pinco.com
it redirects to www.pinco.com/projectname/public/
but it shows www.pinco.com/projectname/
.
How can I achieve that?