Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Redirecting picture hotlinkers (http://www.greenguysboard.com/board/showthread.php?t=16293)

Fonz 2005-02-09 08:58 AM

Redirecting picture hotlinkers
 
Hi,

I'm being hotlinked on this page right here
So I put up a .htaccess file that forwards these hotlinking bastards to a paysite. But because they load the images on their site only a red X shows up and there's no visible forward (sponsor does count the hits). Anyone know a code that I can use to let that paysite "break out" of this image placeholder?

Thanx

PR_Tom 2005-02-09 10:05 AM

I dont have one that will do that, but I have one that replaces the gif or jpg or jpeg being hotlinked with another image you specify (such as one that says "visit my site to see all of my images" with your url)

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteCond %{REQUEST_URI} !^/replaceimage\.
RewriteRule \.(gif|jpe?g)$ /replaceimage.$1 [NC,L]


replace "yourdomain.com" with your domain of course.

replace "replaceimage" (in both places) with an unusual and unique name that you will never name a "real" image! Thats important! (name it something like: qsgrt3lkhj or something)

Then you need to create a gif, jpg and jpeg version of your image! ie:
qsgrt3lkhj.gif
qsgrt3lkhj.jpg
qsgrt3lkhj.jpeg

The code will see where the request comes from, if it isn't blank or yourdomain, and if the image being requested is NOT your "replaceimage", it will replace the image with your new image which you've made.

Hope that makes sense..

Fonz 2005-02-09 10:52 AM

Yeah I know how to do that but I want to redirect the surfer directly to the sponsor's site.
Thanx for the reply anyway :)

cd34 2005-02-09 11:02 AM

since the surfer is expecting an image, redirecting them to the site will do nothing more than create a fake 'click' on the sponsors page.

You have to hand them an image or something. You could always hand them an image with the site name that you want to advertise.

PR_Tom 2005-02-09 11:46 AM

"Never mind." - Emily Latella :D

Fonz 2005-02-11 04:26 AM

Ok thanx guys, I just linked it to an image with a small text and URL on it. And guess what, people actually type in this url :D


All times are GMT -4. The time now is 04:34 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc