My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How exactly should I set a custom 503 "Page is down for maintenance" for my local website?

Asma Moosagie's photo
Asma Moosagie
·Nov 28, 2018

Hi :)

I've looked at a few different .htaccess file configurations and was reluctant to try them out before getting an opinion from someone who's done it before.

I'm working on somebody else's website, and I'd like the 503 page to display for a couple hours instead of having the old version of the website show.

These are the 2 different configs:

Number 1 :

ErrorDocument 503 /index.html

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.html [R=503,L]

Number 2 :

ErrorDocument 503 /path/to/503.html

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111$
RewriteCond %{REQUEST_URI} !\.(css|gif|ico|jpg|js|png|swf|txt)$
RewriteRule .* - [R=503,L]

I've had some bad experiences before with .htaccess files messing up my webpages, so if you could just point me in the right direction that would be great.

My primary concerns are that both the above solutions are no less than 6-8 years old, and that I'm really not sure which of the two I should use because they look pretty different.

Thanks for reading.