How to block visitors from visiting your website using htaccess

| Last Updated: | In: 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 xxx.xxx.xx.xxx 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.

Tags: , , , , , ,


About: Prem Tiwari

Prem Tiwari is founder of freewebmentor.com and Software developer from New Delhi (India). Follow Prem's development codes on facebook, and make sure you check out freewebmentor.com for the latest in web development related Tips with the complete code.


You may also like:

Follow us!

Get Free Access of 350+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Learn how to implement security guideline in your WordPress site...

DOWNLOAD

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...

SEARCH NOW