Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a website which I'm planning to keep in maintenance mode for about 2 days without losing SEO ranking. According to Google blog post, we can do this by having a 503 Service Temporarily Unavailable with Retry-After header.

I have used the following code in .htaccess file in the root directory (for 503).

My problem: How to use the Retry-After header. Can anyone help me with this?

ErrorDocument 503 "Our website is temporarily closed for maintenance."
RewriteEngine On
RewriteRule .* - [R=503,L]
share|improve this question
up vote 5 down vote accepted

You can use the retry-after header like this.

ErrorDocument 503 /503.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/503.html$
Header always set Retry-After "3600"
RewriteRule .* - [R=503]

Here is a blog post for more details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.