I've searched in Drupal forums and on the net, but couldn't manage to get this solved: How to redirect each multisite "mysite.com" to it's respective "www.mysite.com" ? I tryed many RewriteRules: 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. ------------------------------------------------------------------------ --------------------------- RULE 3: RewriteCond %{HTTP_HOST} ^www\.[^.]+\.com$ [NC] RewriteRule ^http://www\.([^.]+)\.com/$1 [L,R=301] RESULT: Nothing happens. Site addresses are not redirected in any way apparently. ------------------------------------------------------------------------ --------------------------- Please, could anyone suggest a RewriteRule (Cond) that redirects ALL multisites to their corresponding www. address? I swear I will make the reply into a Handbook page ;) Cheers, Marco
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@leflo.de site....http://leflo.de/
Florian: great guess man! It works superfine, you made this a better weekend for me, thank you! :) I will post it in a handbook page as promised, cheers -marcob On 03/nov/06, at 6:31 PM, Florian Kriener wrote:
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@leflo.de site....http://leflo.de/ -- [ Drupal support list | http://lists.drupal.org/ ]
participants (2)
-
Florian Kriener -
marcob