Restrict Website Access During Development in cPanel or Plesk
When you want to restrict website access during development, this article explains how to use cPanel and Plesk tools such as password protection, maintenance mode, and IP restriction using .htaccess to limit access to specific users or IP addresses.
If you would like to limit access to your website during its development, so that only you and your developer can access it, there are several ways to do that.
Use a maintenance plugin
There are plugins for web applications that provide maintenance functionality. Depending on the plugin used the maintenance functionality may be different, but usually, visitors to your website see a "coming soon" page or a page that shows a timer how much is left until the website is publicly accessible. Using plugins allows you to customize the maintenance pages, so you can develop them to match the look on your website. You can find these plugins in the official extension repository of the website's application, for example:
Password protect the website
Using cPanel's Password Protected Directories tool, you can add password protection on your website. This will make the website only accessible to people who know the credentials for accessing it.
To password protected directories in cPanel, you can follow the steps mentioned below:
- Login to the cPanel for the domain
- Under Files tab click on Directory Privacy
- Select the directory for which you wish to setup password and click on Save
Block all access and allow only your IP
To use this method you should open the .htaccess file for your website and inside it, place the following lines at the top:
|
order deny,allow deny from all allow from IP.IP.IP.IP |
Replace IP.IP.IP.IP with your local IP address and save the file. You can edit the .htaccess file via FTP, SSH or by using the File Manager in cPanel.