How to deny access to a single IP Address using .htaccess

Letís assume that you wish to deny or block access to your website from IP address.

The below lines provide the means to allow access to your website from all users except one with the IP Address:

# Order Allow, Deny

Deny from
Deny from

Allow from All
# Order Deny, Allow
Deny from
Deny from

If there are multiple IPís to which you want to deny access, simply add as many ĎDeny fromí rules as needed.

Was this article helpful?

Thanks for your opinion!
Have more questions? Submit a request