Forum Moderators: phranque

Message Too Old, No Replies

Mod Rewrite Help

Please check my script, let me know if it's correct

         

Terabytes

2:30 am on Nov 1, 2005 (gmt 0)

10+ Year Member



Hi!

I currently have two domains example.com, and example.net

I currently have the following mod rewrite to solve my problem hopefully...

=================
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.net
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example\.net
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
================

I'm attempting to move the .net to the .com without damaging my current placement in the SE's.

Am I doing this right? I stand to lose a great deal if it's wrong in the SE's.

I just don't have enough experience to know if it's correct, I utilized an example from another post and modified it for myself...

So my real question is:

Will the SE's change all the listings (eventually) to the www.example.com domain name, while eliminating the .net domain name?

Thanks in advance!
You guys ROCK!

Terabytes

11:54 am on Nov 1, 2005 (gmt 0)

10+ Year Member



...bump!

jdMorgan

3:49 pm on Nov 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We don't get a lot of traffic back here, and there are usually many more askers that answerers, so sometimes it takes awhile...

Your code as written should redirect requests as you describe. You may need to add the "Options +FollowSymLinks" directive at the top in order to enable mod_rewrite; Try that first if it doesn't work.

However, search engines do what they want to do, so I cannot guarantee that using this code will cure your ranking/listing problems.

You should test the code using a server headers checker [webmasterworld.com], to make sure that each requested page is redirected as desired (I mean test a sample of URLs in each domain, not all URLs), and that the proper 301-Moved Permanently status is returned.

Jim

Terabytes

8:12 pm on Nov 1, 2005 (gmt 0)

10+ Year Member



Thanks for the reply...

I've already noticed some changes in the G serps, so I'm thinking that I may just have it correct...

Y is the one that is messed up...I'll just have to watch...

thanks again!
Tera