Fighting Spam code for htaccess

Wire Article Published by thuvalpakshi on 04, Wed Sep 2024
Stars Rating : no stars yet..!
Comments Total : no comments yet..!
Created on : 04, Wed Sep 2024

Hi, after posting a blog regarding fighting spam, I just enilighted with a bright idea of automatic deny in htaccess. For this I must have two files having denied ips and allowed ips. then in htacess a few lines will do the magic

# Block by Deny IP file
<RequireAll>
# Allow IPs from the allow_ips.txt file
<RequireAny>
# Load allowed IPs
Require ip env=allowed_ips
</RequireAny>

# Deny IPs from the deny_ips.txt file
<RequireNone>
# Load denied IPs
Require ip env=denied_ips
</RequireNone>
</RequireAll>

# Include the IP files to define environment variables
Include /path/to/deny_ips.txt
Include /path/to/allow_ips.txt


Comments on this Post

No comments posted yet..! Be the first one to post comment.


Your Comments on this post