开发者

How to remove unwanted subdomain with .htaccess?

For whatever reason, my client's site is showing up in Google with a compet开发者_如何学Goitors phone number in the subdomain. Not all results, but several results are showing it now.

So what should be www.clientsite.com is coming up with www.800-555-1212www.clientsite.com

How do I set my .htaccess to keep it just as www.clientsite.com?


RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com
RewriteRule .* http://www.clientsite.com/$0 [redirect=permanent,L]


I've found that this works

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+)\.clientsite\.com$ [NC]
RewriteRule .* http://www.clientsite/$0 [redirect=permanent,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜