Forum Moderators: phranque

Message Too Old, No Replies

Avoiding Redirect Loop

         

virgvv

10:57 pm on Jun 14, 2010 (gmt 0)

10+ Year Member



I know the basic rules of 301 rewrite and redirection, but I've got a situation with a client site that I'm not sure how to handle.

His current site (an ecommerce store) is www.domain-A.com. He has a 2nd domain name, www.domain-B.com, which forwards to Domain A.

We're moving the store to a new server, and he also wants to use Domain B exclusively from now on.

I've set up redirects in the old Domain A ASP files (new store is a LAMP setup), but until Domain B propagates at the new address, I think we'll get a loop that's going to throw 500 server errors. Domain B redirects to Domain A, which redirects to Domain B...

One way to handle the problem is to set up Domain B at the new address and leave the old store up at Domain A for a day or two, until I'm sure Domain B has propagated.

But is there a more elegant way to do this?

Thanks.

g1smd

11:22 pm on Jun 14, 2010 (gmt 0)

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



Your move to the new domain will take a while to show up in the SERPs as Google will have to undo all the redirects that the domain has previously returned for all requests.

So, "hosting A" hosts "domain A" (the store) and "domain B" redirects to "domain A".

You are moving "domain B" to "hosting B" and setting up a redirect from "domain A" to "domain B".

I'm not sure which order I would change stuff over, but I know I would want to point all domains at "hosting B" and sort out the correct redirects in the .htaccess file there.

You mustn't have a live store on both hosts at the same time unless they both access a common database... otherwise you are going to lose data when you move the database over. You need to make the old store non-active before you copy the data to the new store and re-activate the new store only when all the old data is present.

virgvv

12:06 am on Jun 15, 2010 (gmt 0)

10+ Year Member



Thanks for the quick reply.

Having two stores is possible because they're using completely different software, databases and hosts: current store is an ASP host-your-own store; store on Domain B is a PHP hosted solution.

Google is currently indexing Domain A's pages and hopefully won't take too long to index Domain B once I've put the 301 redirects in place.

Given that, do you think the two stores solution makes sense?

virgvv

12:38 am on Jun 15, 2010 (gmt 0)

10+ Year Member



Ah, never mind. I see what you're getting at.

He only makes 3 to 5 sales a day, so importing data for the new store wouldn't be too much of a hassle. Probably better than having potential customers see a 500 or 404 error message.

I can't see any other way to do it, unless someone has a better method involving htaccess magic.

jdMorgan

2:02 am on Jun 15, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do things in order and be patient. You can scuttle the project from the outset otherwise...

Get the new server all set up and ready to serve pages/customers.
Change the DNS for the new domain to point to the new server.
After the DNS propagates, install the redirects.

Jim

virgvv

2:54 am on Jun 15, 2010 (gmt 0)

10+ Year Member



Patience? What's that? :-)

Yes, I'll do things in that order, and hope the domain doesn't take too long to propagate.

Thanks.

jdMorgan

12:33 am on Jun 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Normally, it takes four hours for modern ISPs. Some ISPs using ancient equipment might take 48 hours. Some 'broken' DNS servers might not update for a long time, but you can't really help that.

Jim