Reputation: 6182
For whatever reason, my client's site is showing up in Google with a competitors 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?
Upvotes: 1
Views: 2161
Reputation: 116120
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.clientsite\.com
RewriteRule .* http://www.clientsite.com/$0 [redirect=permanent,L]
Upvotes: 3
Reputation: 6182
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]
Upvotes: 0