Block IPs with an image?

Fix it!!

Block IPs with an image?

Postby blu87 » Thu Feb 15, 2007 11:04 pm

Is there a way to set something up via .htaccess and php so I can use an image to block users by IP if the image is on a website that's not mine?

An example: My cousin signed up with one of those blog/networking sites that doesn't allow users to use javascript. It only allows html and css. What I've been asked to do is to put an image on my cousin's blog site from my website. When this image is loaded, it should block users from my cousin's blog site by IP address. I figure maybe I could set something up in htaccess that when the image is loaded it rewrites or redirects the user to another site and they can't view my cousin's blog site.

Is something like this even possible?


I've managed to setup an IP tracker by using a similar method. When the image is loaded, a rule in htaccess redirects the image to a php file that logs the user's IP address. The user doesn't know this has been done and everything looks normal to them. Of course, it took me 1 1/2 weeks to figure this out. I know nothing about htaccess and php. I only stumbled onto a way to do that out of sheer luck.
blu87
 
Posts: 1
Joined: Thu Feb 15, 2007 10:48 pm

Postby richardk » Fri Feb 16, 2007 7:54 am

Mod_rewrite can only affect the server it's on. You can block people with certain IP addresses from accessing the image, but not the blog page.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 10 guests

cron