Security

How to quickly put your website to maintenance mode

Share
5/5 - (3 votes)

Sometime we need to put off a website for security reasons. For example when a customer get a malware or the site is hacked and we must organize well to cover all the points that are needed:

  • Clients must reach the website with maintenance page, put there all usefull information.
  • SEO problem: the pages must not have a redirect 301 or 302!! error 503 is a better solution.
  • You need to exclude yourself for diagnostic purpose.

Time Needed : 0 days 0 hours 3 minutes

These steps work with Apache:

  1. Create an HTML page like that maintenance.html on you root’s site.

    <html> <body> <h1>This site is temporarily under maintenance.</h1> <h2>Will be back soon, please come back later.</h2> </body></html>

    Related Post
  2. Enter this text on top of your .htaccess .

    #MAINTENANCE-PAGE REDIRECTErrorDocument 503 /maintenance.html<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_ADDR} !=<YOURIPADDRESS> RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC] RewriteRule ^.*$ - [R=503,L]</IfModule>

  3. Happy hunting!

    Now you can find and fix the problem!When you finished remove all lines you put on your .htaccess file

ErrorDocument 503 /maintenance.html means that if client get a 503 error will be redirect to maintenance page

RewriteCond %{REMOTE_ADDR} !=<YOURIPADDRESS> helps you to reach your site!

RewriteRule ^.*$ - [R=503,L] put a 503 error without change the URL.

dc

Published by
dc

Recent Posts

Citrix ADC Gateway page loading issue with Chrome v100

There is a great problem with last major update of Chrome (and all browsers Chromium…

April 14, 2022

VMware HealthAnalyzer

Learn how to download and how to use VMware HealthAnalyzer. Complete guide here!

February 18, 2022

Bye bye VMware Converter! Welcome Application Transformer for VMware Tanzu!

VMware decided to remove VMware Converter from download area. So there is no an official…

February 12, 2022

Con VMC on AWS e HCX puoi muovere le VM a caldo?

Certo, ma… come sempre accade è sempre meglio verificare alcuni prerequisiti fondamentali di una vMotion…

June 29, 2020

VMware on AWS: HCX. Please, don’t change anyting!

shot story: Customer changed the name of a network that was extended by HCX. The…

May 21, 2020

My choices for TLS 1.2 and TLS 1.3

Intro Enable TLS 1.2 now! Starting from March 2020, the most used browsers will no…

March 23, 2020