---
title: How to Block Any IP Address via an htaccess Rule
description: "If you want to block an IP Address, you can add the below lines to your htaccess file. ```markup order allow, deny deny from IP-ADDRESS allow from all ``` Replace **IP-ADDRESS** with the IP you want to block."
url: "https://www.aeserver.com/support/how-to-block-any-ip-address-via-an-htaccess-rule/"
updated: "2025-01-05"
category: htaccess Tutorials
---

# How to Block Any IP Address via an htaccess Rule

If you want to block an IP Address, you can add the below lines to your htaccess file.

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

Replace **IP-ADDRESS** with the IP you want to block.
