Forum Moderators: phranque

Message Too Old, No Replies

domain redirection

multiple domains on one host

         

fastnet

2:09 pm on Apr 23, 2005 (gmt 0)

10+ Year Member



Impressive forum!

I have a situation where I have more than one domain hosted on one host. The domains are parked elsewhere and all point to the same server. On that server I have subdirectories for the domains as follows:

/domain1/domain1 subdirectories
/domain2/domain2 subdirectories
etc

and using mod_rewrite I get it so www.domain1.co.uk ends up in domain1 and www.domain2.co.uk ends up in domain2 etc.

My question is this: I am currently using a RewriteCondition eg

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain1.co.uk$ [NC]
RewriteCond %{REQUEST_URI}!^/domain1/(.*) [NC]
RewriteRule ^(.*)$ /domain1/$1 [L]

etc for each domain but it seems the same thing can be done with RewriteBase. Most people seem to favour using RewriteCondition but given the greater complexity and HTTP/1.0 problems wouldn't using a rewriteBase rule be better such as:

RewriteEngine On
RewriteBase /domain1
RewriteRule ^(.*)$ /domain1/$1 [L]

or am I missing something really obvious?