implemented a 301 redirect with weird results

CLOSED

implemented a 301 redirect with weird results

Postby tomc » Thu Jun 24, 2010 9:55 am

I implemented a 301 redirect on my site that I thought would solve my problems (which they did to an extent), unfortunately other things occurred which I'd like to fix too.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http$2://www.example.com/$1 [R=301,L]

Background:

There are quite a few domains pointing to my site. There is the main one, and quite a few others.

It appeared that some of these other domains were starting to appear in google search results.

Function of code above:

For those who don't know, the code I display above means if you access the site from another domain, the domain will be redirected to the main one (www.example.com).

IE. Access the site with www.example1.com or www.example2.com (etc), it will redirect 301 you to www.example.com.

Unfortunately, it also seems to of messed with the search results. Either google is having an off couple of weeks with indexing, or something else needs to be tweaked in the code. The other domains are now appearing more frequently in the google search results and that didn't happen before. I would prefer if they did not show up at all.

Would anyone be able to provide assistance?
tomc
 
Posts: 3
Joined: Wed Jul 08, 2009 11:14 am

Return to New Threads/Problems

Who is online

Users browsing this forum: No registered users and 4 guests

cron