Hi @normski52,
When an IP is blocked with Wordfence, we present them with a blocking page.
It has been suggested that this blocking page could be customized.
However, there is another way to do this.
Add this to the beginning of your .htaccess:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} #####
RewriteCond %{REQUEST_URI} !=/home.php
RewriteRule .* /home.php [L]
Change /home.php to what page blocked people should be redirected to.
Change ##### to a regex pattern to match your IP ranges.
Generate a regex pattern with an IP range here: https://d-fault.nl/CIDRtoRegEx
1. For example, my IP range could be 1.1.1.1/24
2. Converted, it looks like ^(1\.1\.1\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5])))$
3. Then the rule would be RewriteCond %{REMOTE_ADDR} ^(1\.1\.1\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5])))$
Now when people visit, and their IP is within that range, they will be automatically redirected to /home.php, and if they try to navigate to a different page, they will be sent right back.
Dave
wfdave
Many thanks for your response. That’s much appreciated but it looks a bit too complicated for me. I will see if my developer can carry that out for me.
All the best.
Hi again,
No problem!
Could I ask why you want to redirect blocked IPs to a different page?
Would it help if in Wordfence, you could customize the locked out/banned page?
Dave
Hello and thanks again Dave.
An individual is accessing pages on my website that I don’t want them to access. I don’t want to alert them to the fact that I have detected the intrusion. I would like to send him/her back to the home page of the site.
But, as an alternative it would help if I could redirect to the home page.