0

A friend of mine has a strange problem: His website is reachable with w.domain.com and ww.domain.com and Google has started to index these sites.

How is it to achieve, that both subdomains are redirected to www. ? Is it the same way as normally? Like:

RewriteCond %{http_host} ^domain.com [nc] 
RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Simply write 2 other RewriteConds with ^w.domain.com & ^ww.domain.com ??

Thanks for any suggestions!

4

1 回答 1

0

假设您要将所有流量重定向到 www.domain.com:

RewriteCond %{HTTP} !^www\.domain\.com [NC] 
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,NC]
于 2013-02-04T07:08:39.013 回答