In this article I’m going to teach you how you can disable a problematic site on your hosting account via a .htaccess file, so that you can troubleshoot any problems while leaving your other sites online.
There are many factors involved that could cause a website to start using up a lot of resources from a server, and in some cases this usage can be extreme enough that it could lead to an account suspension of your account. By disabling the one problematic site on your account causing excessive resource usage, you can continue to have your other sites and email run unaffected by a possible suspension.
Disabling problematic site via .htaccess
Using the steps below I’ll show you how we can temporarily disable a site called example.com on my account using a .htaccess file, so that it doesn’t cause problems for the other domains on my account.
- Login to your cPanel.
Under the Files section, click on File Manager.
- Locate your .htaccess file, you may have to show hidden files.
Right-click on the .htaccess file and select Edit.
- If your .htaccess file didn’t exist already during the previous step, click on +File at the top-left, name the file .htaccess, and finally set the directory for the file to be created to /public_html/ or the document root of your site.
You might have a text editor encoding dialog box pop-up, you can simply click on Edit.
- Enter in the following code in your .htaccess file to disable the site:
ErrorDocument 503 "<h1>Site temporarily down for troubleshooting</h1>"
RewriteRule .* - [R=503,L]
Then click on Save Changes up in the top-right of the text editor.
This will serve a 503 response to every request. This response code signifies a temporary server issue and search engine bots know to attempt their requests again at a later time so it doesn’t affect your search engine rankings.
If you leave these rules in place for more than 2 days search engines such as Google could start interpreting these temporary issues as longer lasting ones, and this could affect your search engine ranking.
You should now understand how to temporarily disable a problematic site so that your entire account isn’t affected by its usage. If there are only certain types of requests that are causing problems, you can selecitively limit those types of requests as well.
For more information on that I’d recommend reading my other article on block users based on their user-agents which mentions using a 403 access denied response to block particular user-agents that might be slamming your site.