I have a script that is automatically adding IP addresses to my.htaccess file based on lookups in spam databases. However, I would like for subsequent visits from those addresses to be able to view a 403 ErrorDocument I create. Obviously, though, they cannot, as they have been denied. My .htaccess looks like this:
ErrorDocument 403 /403.php
deny from <ip address>
deny from <ip address>
deny from <ip address>
deny from <ip address>
yada yada yada
Any suggestions on how to do this? I am adding the addresses via PHP.
Thanks in advance.
You have two way:
of course, First one will redirect user!
If you have particular file formats on your site(like .php,.txt,.xml,.htm,…) you can use this one but I DO NOT recommend it!
Update:
As
Sean Kimballmentioned you can use rewrite mod (of course it’s possible,it’s Apache)