While doing updates to your website, you may want your site temporarily unavailable to your clients. There are two ways to make your website inaccessible for your clients except for yourself.
You can add a code to your .htaccess file via your File Manager:
Step 1. Open a browser and navigate to this link: https://whatismyipaddress.com/ to get your IP Address.
Step 2. Once you get the IP Address, open a notepad, copy and save the IP Address from there.
Step 3. Log in to your cPanel account: yourdomain.com/cpanel. In case you forgot your log in credentials, click the link on how to update your cPanel password.
Step 4. Navigate your File Manager, make sure to select ‘Show hidden files’ and go to public_html folder.
Step 5. Create a file and name it as ‘.htaccess’, if this is not yet available, and add the code below:
|##### Order deny,allow
Deny from all
Allow from 184.108.40.206 #####
Once you’re done, save the codes you’ve added on the file and clear your browser’s cache. All your visitors won’t able to view your website except you, unless the codes are removed.
via IP Blocker
The IP Blocker interface allows you to allow you to block access to your site for one or more IP Addresses or fully qualified domain names (FQDNs). Below are the steps on how to block IP from access your site:
Step 1. Log in to the cPanel using this link format: http://yourdomain.com/cpanel/
Replace yourdomain.com with the Main Domain Name connected to your hosting.
Step 2. Click IP Blocker under Security panel.
Step 3. Enter the IP Address or range in the IP Address or Domain box. You can enter IP Address in any of the following formats:
- Single IP address (for example,220.127.116.11).
- Range (for example, 18.104.22.168-22.214.171.124).
- Implied range (for example, 126.96.36.199-99).
- CIDR format (for example, 188.8.131.52/99).
- Implied IP address (for example, 180.*.*.*).
|Important: 180. as an implied IP address, if you enter 180., the system blocks access to any IP address that begins with 180.|
Step 4. Click Add to save the changes.