Forum Moderators: open

Message Too Old, No Replies

Is Google ok with rewritecond in .htaccess?

         

TerryMc

4:30 am on Nov 10, 2004 (gmt 0)

10+ Year Member



I recently dropped in the listings and have been trying to find out why, and I discovered that Google was indexing our .net .biz and .us as separate sites. I had them all aliased to the .com site. Anyway, I added this to .htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [OR]
RewriteCond %{HTTP_HOST} example\.biz [OR]
RewriteCond %{HTTP_HOST} example\.net [OR]
RewriteCond %{HTTP_HOST} example\.us
RewriteRule ^(.*)$ [example.com...] [R=permanent,L]

Will google have any issues with this?

Thanks

[edited by: vitaplease at 7:04 am (utc) on Nov. 10, 2004]
[edit reason] examplified [/edit]

Stark

9:54 am on Nov 10, 2004 (gmt 0)

10+ Year Member



I believe in this instance, Google will view them all as seperate sites because the mod-rewrite translation is all done 'behind the scenes'. Google (or indeed any user) will have no idea what the translated URL will look like and hence has no idea that they are all the same thing.

Of course, this means that you have multiple copies of the same site indexed in google and that you will undoubtedly trip a duplicate content filter.

I suspect your best option is to redirect visitors from each of the 3 domains to 1 domain that you choose as your main site. This way, inbound links to any of the 3 should flow to the one main site, and you will not have duplicate copies of the site in google. Using a 301 redirect should accomplish this easily - although how you set this up directly from apache I don't know... sure it must be possible though.

[edited for typos]

b0rdslide

4:41 pm on Nov 10, 2004 (gmt 0)

10+ Year Member



I suspect your best option is to redirect visitors from each of the 3 domains to 1 domain that you choose as your main site. This way, inbound links to any of the 3 should flow to the one main site, and you will not have duplicate copies of the site in google. Using a 301 redirect should accomplish this easily - although how you set this up directly from apache I don't know... sure it must be possible though.

Isn't that exactly what he is doing with those rewrite rules?

g1smd

10:49 pm on Nov 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I think the syntax is wrong.

It should be ^example\.com$ on each of the 4 lines.