How to block referring site PLUS certain IPs in same .htaccess file... HELP!!!

Discussion in 'Site & Server Administration' started by timothius, Jul 19, 2008.

  1. #1
    Ok, I am going to make this the least complicated I can here. I would be SO happy if someone could help me out here...

    I want the following TWO things to be happening in my .htaccess file.

    1) If visitor arrives at any page of my site from baddomain.com, I want him to be redirected to a *SPECIFIC* page on my site where I can gather his IP address. (The specific page will then whisk him back off to baddomain.com via a meta redirect)

    2) If a malicious visitor that has a particular IP address comes to any page on my site, I want him to be redirected a *DIFFERENT SPECIFIC* page on my site that would be a fake 404 page.

    Here is the code I have so far, but I believe I have some syntax and logic problems with it. I'm rather new to .htaccess files. What I have below doesn't work for both instances.

    I think that is the clearest I can put it.... if you can help, I would be very happy, and could finally sleep tonight.

    THANK-YOU IN ADVANCE!
     
    timothius, Jul 19, 2008 IP