wp1wlq
Last Updated: February 25, 2016
·
691
· jasny
Arnold

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.

Say Thanks
Respond

1 Response
Add your response

11539
9ba70a523a1b79e66aa30853882f0022

Nice, thanks for this! I'll have a need for it before the year is out.

over 1 year ago ·