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]

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .