New customers save 5% – use code GURU5Shop Deals →
Security

How to ban any IP Address via .htaccess?

If someone is trying to hack your website or you want to block their IP Address, you can add this line to your .htaccess file.


order allow,deny
deny from IP-ADDRESS
allow from all

Replace “IP-ADDRESS” with the IP Address you want to block.

Was this article helpful?

Let us know — it helps us improve our documentation.

🙏
Thank you for your feedback!

Your input helps us write better guides for everyone.

← Browse more articles
⚡ Best Value
Shared Web Hosting

Fast LiteSpeed hosting from KES 199/mo. Free SSL, free domain & 24/7 support.

View Plans →

Latest from the Blog

View all articles →