Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop search engines indexing a maintenance page

I need to setup a maintenance page for a website I'm running, e.g. for display when I'm performing site maintenance (scheduled downtime) or if something really breaks and I need to put up a holding page.

Is there anything special I need to do to ensure that search engine crawlers don't index it and think that it's my site. Or should I do a 404, add a temporary robots.txt file or something? I basically don't want them to index it as my site, but I also don't want them to think my site is dead and not come back.

Edit: Here's what I did in Apache: ErrorDocument 503 /.server-maintenance.html RewriteEngine On RewriteRule !^.server-maintenance.html /server-maintenance Redirect 503 /server-maintenancestrong text

like image 349
DEfusion Avatar asked Apr 07 '09 16:04

DEfusion


People also ask

How do I stop my search engine from indexing?

You can prevent a page or other resource from appearing in Google Search by including a noindex meta tag or header in the HTTP response. When Googlebot next crawls that page and sees the tag or header, Google will drop that page entirely from Google Search results, regardless of whether other sites link to it.

Should I discourage search engines from indexing this site?

WordPress site owners will do anything to get their websites indexed. However, you might not want search engines to crawl through your website if it's still in development. In a case like this, it's recommended to discourage search engines from indexing your site.

How do I stop staging my site from being indexed?

If a publisher is testing a new web design, they can create a subdomain and test the new website design there. Traditionally, the most common way to block Google from indexing a staging site was to create a robots. txt file that keeps Google from crawling the staging site.


1 Answers

You should send a 503 Service Unavailable HTTP status code, and not a 404. Use this in conjunction with a Retry-After header to tell the robots when to come back.

like image 69
David Kolar Avatar answered Sep 21 '22 08:09

David Kolar