5

I have a client who currently has their website hosted with Moonfruit.

I've developed a new WordPress site for the client that I'll be launching next week, but need to transfer the domain to my registrar today.

Once the domain has successfully transferred to my registrar, I'll be pointing the domain to a holding page on my server until the new site is ready.

So that I don't lose any efforts made on SEO, I'd like to set up 301 redirects. These redirects will point to the new pages.

Until the site is ready, where do I point the 301 redirects? Should I create temporary pages on the new server for the 301 re-directs until the new site is launched?

It's necessary for me to transfer the domain now so that DNS propagation is resolved before we launch the new site. I can't migrate the old site to my server because it's hosted with Moonfruit.

  • 1
    Alternatively, return 503 Service Unavailable and echo something about maintenance. – ArtOfCode Jul 7 '15 at 17:57
8

It takes weeks for Google and other search engines to de-index pages and even longer for a website, which would in time would hurt your rankings. The only thing you need to do is return a status 503 rather than a 301 to 404.

This is the definition of the 503 status code from the RFC that defines these status codes:

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

This can be done easily in the .htaccess file or PHP:

HTACCESS ~ Recommended Method

RedirectMatch 503 ^/(?!holding\.html)
ErrorDocument 503 /holding.html
Header always set Retry-After "3600"

PHP

$protocol = "HTTP/1.0";
if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] )
$protocol = "HTTP/1.1";
header( "$protocol 503 Service Unavailable", true, 503 );
header( "Retry-After: 3600" );
  • Is there a way to exclude images and CSS from your htaccess method? New question here. – Sam Jul 8 '15 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.