Mobile app version of vmapp.org
Login or Join
Annie201

: How can I mask sub-directory to work as DocumentRoot for multiple domains pointing to the same location? I am trying to mask sub directories to effectively work as DocumentRoot for multiple domains.

@Annie201

Posted in: #Htaccess #Masking #Redirects #UrlRewriting

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 192.168.1.30] 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.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme