503.sh
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
503.sh [2007/10/16 18:17] – 196.217.233.196 | 503.sh [2007/10/16 19:08] (current) – old revision restored andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Return 503 Status with Apache ====== | ||
+ | Sometime you want to do some heavy work on a virtual host and don't want anyone access your page. But you can't shut down your whole server and don't want to use any redirects to avoid confusing search engine spiders. Well the correct HTTP status code to return is a 503 - Service temporary unavailable. | ||
+ | |||
+ | To do this create the following shellscript named '' | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | |||
+ | echo " | ||
+ | echo " | ||
+ | echo "" | ||
+ | |||
+ | cat <<EOF | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | retry in a few minutes</ | ||
+ | </ | ||
+ | </ | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | Then add this to your virtual host config and reload Apache: | ||
+ | |||
+ | <code apache> | ||
+ | ScriptAlias / / | ||
+ | </ | ||
+ | |||
+ | Please note the trailing slash! It's needed! |
503.sh.txt · Last modified: 2007/10/16 19:08 by andi