Temporary Disable Website using .htaccess

This guide is for Linux hosting users who intend to temporary disable their website, due to maintenance or other reasons. Using .htaccess is one of the way to do it.

To do this, the most simple way without having customized maintenance page is to add these two lines in your .htaccess file of your public_html folder:


  1. Deny from all
  2. ErrorDocument 403 "Website Under Maintenance"

Below is an example of output:



If you want to enable the website only for yourself, you can add an “Allow From” line specifying your IP address.
For example:


  1. Allow from
  2. Deny from all
  3. ErrorDocument 403 "Website Under Maintenance"

Add Feedback