Forum Moderators: phranque

Message Too Old, No Replies

Fooling banned visitors with .htaccess?

         

hasm

10:41 am on Oct 4, 2004 (gmt 0)

10+ Year Member



I know how to ban a visitor using a basic deny by IP address in .htaccess. But obviously this is easy to circumvent, as the visitor can use a proxy or otherwise change his IP address. This is assuming the banned visitor knows that he is banned. I'm trying to figure out a way to fool the banned visitor into thinking the site is simply dead, so he won't even bother trying to circumvent the ban.

I set up a custom 403 error page that mimics a 404 error page, but Internet Explorer does not respect custom 403 error pages.

Perhaps some other way to redirect a visitor to a dummy error page using .htaccess (based on the visitor's IP address), instead of doing an outright 403 ban? Or any other ideas?

Wizcrafts

2:40 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



Try this:

RewriteCond %{REMOTE_ADDR} ^IP ADDRESS TO BAN$
RewriteRule .* ht*p://127.0.0.1 [R=301,L]

If this works it will redirect him/her to 127.0.0.1, which is his/her own machine IP, which is not accessible from the web, therefore they should see a standard Internet Explorer Site Not Found page.

I changed one t in the URL to an * to eliminate a dead link. Change it back to a t to use it.

Also, don't forget to escape the periods in the banned IP address with backslashes, as in ^192\.000\.yyy\.zzz$

Wiz