[support] RewriteRules and Multisites

Florian Kriener lists_drupal at leflo.de
Fri Nov 3 17:31:10 UTC 2006


On Friday 03 November 2006 17:14, marcob wrote:
> RULE 1:
> RewriteCond %{HTTP_HOST} !^www\.site1\.com$ [NC]
> RewriteRule ^(.*)$ http://www.site1.com/$1 [L,R=301]
>
> RESULT:
> all my sites are redirected to "www.site1.com"
> ------------------------------------------------------------------------

> RULE 2:
> RewriteCond %{HTTP_HOST} !^www\.site1\.com$ [NC]
> RewriteRule ^(.*)$ http://www.site1.com/$1 [L,R=301]
>
> RewriteCond %{HTTP_HOST} !^www\.site2\.com$ [NC]
> RewriteRule ^(.*)$ http://www.site2.com/$1 [L,R=301]
>
> RESULT:
> Too many redirects occurred trying to open “http://www.kiteatlas.com/”.
> This might occur if you open a page that is redirected to open another  
> page which
> then is redirected to open the original page.
> ------------------------------------------------------------------------

Just a guess (untested):

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

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


-- 
name....Florian Kriener
email...florian at leflo.de
site....http://leflo.de/


More information about the support mailing list