implemented a 301 redirect with weird results


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://$1 [R=301,L]


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 (

IE. Access the site with or (etc), it will redirect 301 you to

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?
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 1 guest