Importance of 503 status code Search Engines SEO

Posted by Raghavan 15 December, 2008

Server returns a 503 (service unavailable) status code when it is unable to handle the request due to a temporary overloading or maintenance of the server.

The effective implementation of this 503 status code can be used under the following circumstances,

  1. Website Maintenance: when you decided to down your website for maintenance passing this code to your users and search engines will be effective. This code tells search engines that the website is unable to serve the content but informs search engines that it has to come back later.
  2. Avoid Overloading: Let us take a typical example of an ecommerce website and during the holiday season they will have the maximum shopping, traffic and conversion so it is important to ensure that the website is at its best serving to users request. During this time you can stop search engines from taking up your bandwidth by passing them a 503 server status code which informs them to come back later. This will stop search engines indexing the website at busy times.

In case 1 you need to ensure that 503 status code is passed to search engines and users informing them on website maintenance where as in case 2 make sure you inform only to search engines and not users. The difficulty would be to recognize search engine crawlers and to only serve this result code when the server is actually under load – but it might be worth following up on if your server resources are limited.

Now let us see how we can implement the 503 server status code using .htaccess for the above cases,

Case 1: Passing 503 to Google and custom error pages for users
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Googlebot|Mediapartners|)-?(Google|Image)? [NC]
RewriteCond %{REQUEST_URI} !^/cgi-bin/error/503\.php [NC]
RewriteRule .* /503-error.php
RewriteCond %{REMOTE_HOST} !^1\.1\.1\.1
RewriteCond %{REQUEST_URI} !^/cgi-bin/error/404\.php [NC]
RewriteRule .* /maintenance.php [R=302,L]

Note: Make sure to inform users with a customized info on website maintenance through “maintenance.php”

Case 2: Passing 503 only to Googlebots
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Googlebot|Mediapartners|)-?(Google|Image)? [NC]
# or RewriteCond %{HTTP_USER_AGENT} ^.*google.* [NC]
RewriteRule .* /503-error.php

Categories : SEO Tags :

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Comments
December 23, 2008

Thanks for Making Aware of this. Nice Post.

Posted by Jignesh Padhiyar
January 17, 2009

If I my site is in html and not php, does this mean that I have to use maintenance.html instead of maintenance.php for case 1.

Posted by Atul
January 17, 2009

The maintenance.html or .php is a page to inform the visitors on the website maintenance. The extension shouldn’t be an issue but I would suggest following uniformity in your web page extension

Posted by Raghavan
January 18, 2009

Thanks for clarification. But does maintenance.html page work if my site is in html and not in PHP.

Posted by Atul
January 19, 2009

Yes it does similar to our other HTML pages

Posted by Raghavan
April 17, 2010

Serving a different content, that's basically what you are suggesting, may be interpreted as cloacking, so nice article, but don't go with it just for search engines.

Posted by Andrea Moro
May 19, 2010

It isn't cloaking since it returns a 503 status code to both search engines and users.

Posted by raghavan8in
Leave a comment

(required)

(required)