I have some domains that all redirect to the same folder (my public_html). I’d like to write an .htaccess file that would send each domain to it’s own folder (thus not displaying this on the navigation bar).
For example, navigating to http://example.com would load the folder /public_html/example.com/ of my server.
In another context, I’ve used this code:
RewriteCond %{HTTP_HOST} example\.com$ [NC,OR]
RewriteRule ^(.*)$ http://www.anotherdomain.com/$1 [R=301,L]
But now I don’t want to redirect to another domain; I just want to fetch the files from a different folder…
Is it achievable? Thanks in advance.
Replace what you have with:
For explicit host redirects: