开发者

How to remove unwanted subdomain with .htaccess?

开发者 https://www.devze.com 2023-01-26 16:49 出处:网络
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.

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

精彩评论

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