Taking your website offline for maintenance
I’ve seen a lot of methods used to take a website temporarily off-line for maintenance. Most involve a using PHP to disable the site or renaming the index file. There is however a far better method of doing this, by placing the following in the virtual host or in an .htaccess:
Header always set Retry-After "Thu, 12 Dec 2014 23:00:00 +0200"
Redirect 503 /
This way you are sure no part of the site is used. Also by returning a 503 http response, search-engine crawlers will not reindex your site right at the moment it is down. You can use ‘ErrorDocument’ to place a different text than the apache default.
Written by Arnold Daniels
Related protips
1 Response
Nice, thanks for this! I'll have a need for it before the year is out.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Apache
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#