Are you looking to restrict access to your website for certain visitors? Using cPanel, you can easily block specific IP addresses.
Identifying a visitor's IP address
To locate the IP address of a visitor, follow these steps:
STEP 1: Log in to cPanel.
There are two methods to log into your cPanel.
- Method 1: Log in to your cPanel directly.
- Method 2: Log in to your cPanel through your Customer Portal.
Through your Customer Portal;
- Log in to your Customer Portal.
- Click on "Log in to cPanel".
STEP 2: In the Metrics section, click on Visitors.
STEP 3: Find the domain name to check its recent visitors, then click the magnifying lens icon.
STEP 4: On the following page, you’ll see the IP addresses of your site visitors.
Blocking a specific IP address
To block a specific IP address from accessing your website, follow these steps:
STEP 1: Log in to cPanel (Refer to the steps above if you need guidance on accessing your cPanel).
STEP 2: In the Security section, click on IP Blocker.
STEP 3: In the IP Blocker section, enter the IP address of the site visitor you want to block in the designated field.
STEP 4: Click the Add tab to see a confirmation page indicating success.
Unblocking an IP address
Follow these steps to unblock an IP address:
STEP 1: Log in to cPanel (Refer to the steps above if you need guidance on accessing your cPanel).
STEP 2: In the Security section, click on IP Blocker.
STEP 3: In the Currently-Blocked IP Addresses section, find the IP address you want to unblock.
STEP 4: Click the Delete icon next to the IP address.
Restricting access to all visitors
You can configure a "deny from all" option to block access for everyone.
To do this, edit your .htaccess file with the following code:
.htaccess deny all IP
Refer to the article How to Edit Your .htaccess File for step-by-step instructions that apply to all .htaccess modifications.
Note: Using this method may accidentally block your access. To prevent this, ensure your IP address is explicitly allowed. To find your IP address, search Google for "What is my IP?". Google will display your IP address in the search results. This feature is available in English only.
If you accidentally block yourself, contact LyteHosting Support. Be prepared to verify your account to have your IP address unblocked.