Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a domain that redirects to a sub folder like so

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ blog [L]

However I would like to hide the /blog I have reviewed the Apache documentation but I am unsure how to complete this. The reason why I need this is because I have three domains that point to the same IP address that have different sub folders for the different domains.

In addition if I have the other domains would I use the following:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ blog [L]
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ blog2 [L]
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ blog3 [L]

Would this be a valid .htaccess?

share|improve this question
up vote 2 down vote accepted

I think you're making this too complicated. Set up apache with one VirtualHost section for each site and each VirtualHost will have it's own DocumentRoot folder that points to the appropriate blog folder.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.