Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

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 am trying to mask sub directories to effectively work as DocumentRoot for multiple domains. e.g. I have two domains - domain1.com & domain2.com both pointing to the same location.

I want domain1.com to load contents in the DocumentRoot of the location whereas domain2.com should behave as if the DocumentRoot for it is within a subdirectory let's say domain2.dir.

How do I achieve this using .htaccess? I tried the following but it did not work:

RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
RewriteRule (.*) /domain2.dir [L]

The error I get is as below:

[Tue Jun 04 17:42:54 2013] [error] [client] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I would appreciate any help on this.

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.