Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.