How to temporary Disable Website using .htaccess?

First of all, as you know .htaccess only applicable in Linux server. Hence, this article will show for user who maintain or running their website in Linux server. You may temporary disable your website for temporary for example for maintenance purpose by using .htaccess.

How to disable htaccess?

To do this, the most simple way by add the following lines in your .htaccess file under public_html folder.

Deny from all
ErrorDocument 403 “Website Under Maintenance”

(This ensure all users can access your website and “Website under Maintenance” message will appear)

If you want to enable the website only for yourself, you can add an “Allow From” line specifying your IP address.
For example:
Allow from 175.140.200.149
Deny from all
ErrorDocument 403 “Website Under Maintenance”

( This to ensure only you can access your website, others can’t)


Comments