I've some domain names that redirect towards the same folder (my public_html). Let me write an .htaccess file that will send each domain to it's own folder (thus not exhibiting this around the navigation bar). For instance, moving to http://example.com would load the folder /public_html/example.com/ of my server.

In another context, I have used this code:

RewriteCond %{HTTP_HOST} example\.com$ [NC,OR]
RewriteRule ^(.*)$ http://www.anotherdomain.com/$1 [R=301,L]

However I'd rather not redirect to a different domain Among the finest to fetch the files from the different folder...

Could it be achievable? Thanks ahead of time.

Replace that which you have with:

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

For explicit host redirects:

RewriteCond %{HTTP_HOST} example\.com [NC]
RewriteCond %{REQUEST_URI} !^/example.com/
RewriteRule ^(.*)$ /example.com/$1  [L]

RewriteCond %{HTTP_HOST} otherexample\.com [NC]
RewriteCond %{REQUEST_URI} !^/abc/otherexample.com/public_html
RewriteRule ^(.*)$ /abc/otherexample.com/public_html/$1  [L]