javacious Posted July 20, 2008 Share Posted July 20, 2008 Ok, I am going to make this the least complicated I can here. I would be SO grateful 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. Options +FollowSymlinks RewriteEngine on # Internally rewrite visitors referred by badsite.com to special page #RewriteCond %{HTTP_REFERER} badsite\.com #RewriteCond %{REQUEST_URI} !^/ipcapture\.html$ #RewriteRule .* http://www.mydomain.com/ipcapture.html # #Code to rewrite visitors with malicious IP addresses RewriteCond %{REMOTE_ADDR} 111\.11\.11\.111 RewriteCond %{REQUEST_URI} !^/new-courses\.html$ RewriteRule .* http://www.mydomain.com/fake404.html 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.