Join dotcomUNDERGROUND on Facebook Follow dotcomUNDERGROUND on Twitter Get updates by email dotcomUNDERGROUND RSS Feed
Thursday, August 31st, 2006

Over a post in Google Webmaster Central Blogs Vanessa Fox stated that when your site goes down for maintenance tou should configure your server to return a status of 503 (network unavailable) rather than 200 (successful). This lets Googlebot know to try the pages again later.

Searching for how i can make my Apache webserver return the 503 – Service Unavailable status code for a particular site on a shared hosting environment i found the following solution over http://wiki.splitbrain.org/503.sh

To return 503 (Service Unavailable) status on Apache Web Server:

Step 1:
Create the following shellscript named 503.sh:

#!/bin/sh
 
cat <<EOF
Status: 503
Content-Type: text/html; charset=iso-8859-1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>503 - Service temporary unavailable</title>
</head>
<body>
<h1>503 - Service temporary unavailable</h1>
<p>Sorry, this website is currently down for maintainance please
retry in a few minutes</p>
</body>
</html>
EOF
 

Step 2:
Then add this to your virtual host config:
ScriptAlias / /path/to/your/503.sh/
Please note the trailing slash! It’s needed!

Step 3:
Restart Apache



Join dotcomUNDERGROUND on Facebook Follow dotcomUNDERGROUND on Twitter Get updates by email dotcomUNDERGROUND RSS Feed
Get updates delivered to your email:  Enter email address:  

Tags: , , , , , , , , ,
Categories: Tech, Tips and Tricks, Tutorials

Sorry, comments for this entry are closed at this time.

Get Update Notifications

 Subscribe in a reader Or, subscribe via email:
Enter your email address:  
dotcomUNDERGROUND RSS Feed
Find entries :

Browse by Tags »