How to block visitors from visiting your website using htaccess

Prem Tiwari - - Freebies

In this tutorial i have shared how to block visitors from visiting your website using htaccess. Lets assume someone is spamming your website from specific IP address to loose your website’s traffic.

Now you can block visitors to access your website from IP address using htaccess code. below is the simple code to block visitor spamming your website.

Copy paste below code to a text file and upload it to the root directory of your website. Then rename it to “.htaccess”. You can also generate htaccess file from this tool click here. You can also add multiple IP addresses in below code Deny from by copy the same line of code.

Block IP Address using Cpanel

You can also block IP address by logging into Cpanel.
Step 1) Login to cPanel and search IP Blocker, click on IP Blocker option.

Step 2) Enter IP address or domain name which you want to block.
Step 3) Click the Add button.

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool tutorials.

Prem Tiwari

Prem Tiwari is the founder of and also a professional developer and a blogger by hobby.

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.