Dealing with Deep-Linking to Your Online Photos?
Pig Hogger asks: "I've had my own hobby website since 1993, and over the years it has expanded to be quite a reference for the domain I am covering (some pro websites list it as additional reference, and so does Wikipedia. Google page-ranks it amongst the top). Every so often, I peruse the logs, most especially looking at the referrers to see where people come from, and once in a while, I notice that some webloggers deep-link to an image on my site. I do not mind too much when it's on-topic, but when it's not *AND* it's sucking-up bandwidth, I tend to be irked. Or worse, when you can't go look at the referring page without registering on the weblog site. In those cases, I change the picture filename (and the corresponding webpage that calls it), and I substitute a smaller (and most often, naughty) picture. What other tricks those of you are facing the same problem have to address this problem?"
> I do not mind too much when it's on-topic, but when it's not *AND* it's sucking-up bandwidth, I tend to be irked.
And you ask this question on Slashdot? Why don't you tell us the URL?
We will show you what deep linking can feel like.
What most websites do is use a CGI script that blocks by Referer and/or IP Address (so like allow any request with your site as a referer, or any IP that has requested another page within the past ~5 minutes, in case people hide referers with crappy paranoid firewalls). You could make it generate a list of pages for you to easily review and allow or block.
Tired of free iPod sigs? Subscribe to my blacklist
"Deep linking" is what makes the web the web.
Free as in mason.
The typical solution to this is serving a complaint image to requests with the Referer header set to something starting with 'http' that don't correspond to your website. Five minutes on Google would have told you this (and provided ready-made recipes for Apache).
I have a file called bestgif.gif on my website - simply put, the best gif ever. Then Mexicans started putting it in their sig on these huge forums, and my bandwidth went up near a few gigs a month (from almost nothing). So...
.*bestgif\.gif$ http://sites.darien.ca/temp/.tubgirl.jpg [R,NC]
RewriteCond %{HTTP_REFERER} ^http://pkpidgeot.com/.*$ [NC]
RewriteRule
I'm willing to bet their accounts got suspended when suddenly their sigs contained a large picture of a large woman spewing a fountain of shit into the air.
My bandwidth usage drops off completely soon after I add a site to the list.
Does your server allow setting up rules by refering site? If a lot came from one place, point them at a "deep linking not accepted" image or give them a 302 redirection back to an image on their site. You could generally turn off deep linking by file type (e.g. jpeg, gif, etc), but that seems extreme.
One line blog. I hear that they're called Twitters now.
Is that perhaps where the goatse picture went?
I use this technique as well, although with a less harsh image saying "thanks for your interest in my pictures, feel free to look at them on dedasys.com".
I wonder what will happen if enough people start using it though - will people simply start copying the images?
I guess if you're worried enough, you can watermark them or use other things to keep them from being useful, if you want people to pay.
BTW, whenever anyone actually asks to use my photos, I always say yes and have never asked for money - what irritates me is people not even asking, or putting a small photo credit.
http://www.welton.it/davidw/
Blocking is easy enough nowadays, but switching images is far more fun. I had this image in my gallery, from when a bus at my university crashed into a dorm. Before a recent football game, a fan from Uconn found this image and used it in a 'we're gonna kick your ass'-type post on their athletics message board. So I saw this in my logs and removed/changed the image to this one. The post was then filled with 'wtf' comments and was pulled a day later :).
I have a number of photo sites, most of which would be interesting only to friends and family, but a couple are of general interest. I don't mind LINKING (as in anchor tags) to my photos, but nobody does that. They EMBED (with img tags) my photos, thus sucking up my bandwidth to enhance their own pages.
First, name your photos with a unique file extension. I use ".jpeg" for photos and ".jpg" for other incidental JPEG files on the site. Then, place this in the relevant area of your Apache config:
### BLOCK IMAGE EMBEDDING
SetEnvIfNoCase Referer "^http://.*yourdomain\.com/" local_ref=1
<FilesMatch "\.(jpeg)">
Order Allow,Deny
Allow from env=local_ref
</FileMatch>
I don't know half of you half as well as I should like, and I like less than half of you half as well as you deserve. BB
Preventing people from *copying* the images is a completely new challenge, and fortunately most people don't worry about that too much.
Deep-linking is more dangerous than copying, because it can unexpectedly cause vast increases to your bandwidth if the image is redisplayed in a more popular location.
Copying... well, it's annoying if someone else uses your photo on a site w/o crediting you, and especially annoying if they are selling prints or something like that, but neither one costs you money (remember, you were displaying it for free), and in both cases they are violating copyright, so you can complain to their host with some reasonable hope of action.
If you're actually a good photographer and are *selling* those photos, then you need to look into ways to make them hard to copy. The obvious is only letting people preview a low-res or plainly watermarked version. You can use that annoying trick of catching the right-click event in JavaScript and popping a copyright reminder notice. You can display a transparent gif *over* the actual photo (defined in CSS instead of an image tag), like Google does for their photos of copyrighted book pages.
There has to be someone out there dumb enough to sue over this...
I would just automatically add a copyright notice to off-site referrers, i.e. generate images with copyright notices.
If trafic becomes too high, you could use another solution, but it does hot sound as if that's the problem.
I think linking is much preferable to copying, since you still have control over the images, and can track who sees them.
In those cases, I change the picture filename (and the corresponding webpage that calls it), and I substitute a smaller (and most often, naughty) picture. What other tricks those of you are facing the same problem have to address this problem?"
Does this mean a goatse or tubgirl link will get you modded up "+1 Informative"?
A sad day, indeed.
all you need to stop people from stealing your images is a no-right-click javascript. sheesh.
...and that's all there is to it.
Here is my .htaccess for doing just this.
l _gifs/ [L,R=permanent]
t id=38$ [NC,OR]l _gifs/funny_looking.gif [L,R=permanent]
3 _1.*$ [NC] /~jondaley/html_gifs/funny_looking.gif [L,R=permanent]
l _gifs/$1 [R=permanent]
I have gotten a number of emails from people who didn't appreciate my changing their image (or their background -- that was a good one, couldn't read the person's site at all)
# Need additional rewrite for the directory without a slash, because otherwise
# the (.*) matches the whole URL. There is probably a better way to do this
# but this works
RewriteRule html_gifs$ http://www.geocities.com/last_id_in_the_world/htm
# People who don't get it...
RewriteCond %{HTTP_REFERER} ^http://www.playahead.com/GroupInfo.aspx.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://www.xanga.com/private/home.aspx$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://www.kindertent.nl/template.php?id=278628&
RewriteCond %{HTTP_REFERER} ^http://nuvoleinviaggio.blog.excite.it/$ [NC]
RewriteRule ^(.*)$ http://www.geocities.com/last_id_in_the_world/htm
# People who don't get it. -- these people are especially annoying,
# as apparently mozilla-- doesn't set the referrer is not set when using style sheets...
#RewriteCond %{HTTP_REFERER} ^$ [OR]
# RewriteCond %{HTTP_REFERER} ^http://www.xanga.com/home.aspx?user=da_forg3tabl
RewriteRule backgrounds/blue-faded.jpg
# uncomment this if you want people who don't have their referrer
# set to also be redirected
RewriteCond %{HTTP_REFERER} ^$ [OR]
# If linked to from somewhere else, forward them to geocities
RewriteCond %{HTTP_REFERER} !^http://www.snurgle.org/.*$ [NC]
# Forward all requests, since we are within the html_gifs directory
RewriteRule ^(.*)$ http://www.geocities.com/last_id_in_the_world/htm
May I make the following suggestions?
and later the key value may be different. That way, you don't rely upon a spoofable header. Yes, this makes your image non-cachable, but if you are using referrer blocking, perhaps that is not a bad thing?
www.eFax.com are spammers
I had this exact same problem with a few images I host on my site. Typically from forums that allow avatars to be hosted offsite. I did a bit of a google on the problem of "hot linking", and came up with this:
http://www.alistapart.com/articles/hotlinking/
It's an excellent solution that prevents hot/deep image embedding, but allows for normal anchor links to your pictures. You'll need to be hosting on an apache server and be allowed to use .htaccess files and have mod_rewrite, plus the tiniest amount of php/perl scripting knowledge (php example in link).
Basically, you rewrite any requests for images from offsite with a URL that points to a script. Embedded images will fail, because the browser expects image data when it gets text/html instead. The script simply displays the image, perhaps puts a credit in, and a link back to your site.
This way, you can block most people from stealing your bandwidth by embedding your images in their pages, but not prevent less-harmful linking.
That image seems to wind up in the Targum and Medium pretty often. :)
(I'm a grad student at RU right now.)
retrorocket.o not found, launch anyway?
The problem is not copying, it is linking and sucking up bandwidth.
Besides which, disabling javascript defeats your trick, and it's in the browser cache anyway. If it's on someone's screen, it's in their computer.
Infuriate left and right
I've always wondered how much of the "bad-ass-apache-admin-handbook" was written by people working in the porn industry. This seems like just the sort of thing they would have mastered way back in the way back. I'd be surprised if there wasn't a handbook somewhere with best practices for serving up the porn.
I used to be the webmaster for a fairly popular (in our particular niche) website with an online store. I got pissed off when I started seeing people putting things up on eBay with IMG tags pointing at our server. So I did what many of you have suggested, set up a mod_rewrite rule that if the referrer was not blank and not our site, it substituted a "Copyright Violation" JPG file (The bosses probably wouldn't approve of Tubgirl or the Goatse guy). I had to discontinue this within a week because a fairly popular BSD router software (can't remember which one, sorry) used to include the IP address of the router in the REFERRER field, and so quite a number of legitimate viewers were getting "Copyright Violation" images in place of ALL the pictures on our site. And the worst thing was, it used the PUBLIC IP in the REFERRER field instead of the private NAT address, so I couldn't even add an exception for NAT space to fix it... After spending another two weeks looking around, I just started banning sites one at a time (eBay...) from being in the REFERRER field and keeping an eye on my logs. PITA, I know...
That was a few years ago, perhaps this is a non-issue now. But keep in mind that people running braindead routers or webcaches might inadvertantly trigger your rule and get pissed. If you're just a hobby site, no big deal, I guess. But if you're making money off the site (online stores and the like) you risk losing business over it.
Description: spoofing vulnarability. Allows: myprefix-yourdomain.com. Patch attached, httpd.conf-remvuln.patch:
--- conf.0 Tue Feb 8 18:07:17 2005
+++ conf.1 Tue Feb 8 18:07:48 2005
@@ -1,5 +1,5 @@
### BLOCK IMAGE EMBEDDING
- SetEnvIfNoCase Referer "^http://.*yourdomain\.com/" local_ref=1
+ SetEnvIfNoCase Referer "^http://.*\.yourdomain\.com/" local_ref=1
<FilesMatch "\.(jpeg)">
Order Allow,Deny
Allow from env=local_ref
... redirect them to one of the GNAA/goats.cx style shock images. Nothing will discourage (most) webloggers from deep linking to your images more than turning their precious 'blogs' in to gay scat porn sites.
get over it.
Instead of using naughty images, make a transparent .gif that's 1x30000 pixels, so it will mess up the layout of the page it's on. It can be 30000 pixels high or wide for different effects.
SetEnvIfNoCase Referer "^http://" remote_ref=1
SetEnvIfNoCase Referer "^http://.*\.yourdomain\.com/" remote_ref=0
<FilesMatch "\.(jpeg)">
Order Deny,Allow
Deny from env=remote_ref
</FilesMatch>
This will let your page work for people with anonymizer services and firewalls which block the referer field. Of course for those people the remote linking will work as well, but usually they are few enough for the bandwidth impact to be negligible.
-- If no truths are spoken then no lies can hide --
You nickname sounds awfully familiar to me. Are you on SKTC by chance?
That, and as others have pointed out, "view source" or "view page info", and/or disabling javascript makes that approach rather pointless.
Besides, it's not about them physically stealing the images (which they can do with screen shots if nothing else; if they can see it, they can save it). The issue here is about them embedding your image in their website.
Yeah, I've done the switcheroo thing too, though not as grossly as others have. Found someone embedding a St. Patrick's image I had in a very republican type bulletin board, so I slightly modified it. As far as I know it's still there after several months; I wonder if they'll notice...-- This
Try this one. Not FOSS, but free-as-in-beer and very pretty. The images are displayed through the Flash app rather than hidden by it, but it's more than enough to stall the average punter, if that's what you want to do.
Except over a remote RDP link, where the fading and flashing can cause a page to take 20 minutes or more to finish loading over a 128kb ADSL uplink.
Got time? Spend some of it coding or testing
...and then shows the menu. It's probably a bug, but it's both useful and amusing.
Got time? Spend some of it coding or testing
You could always do what Rob at Cockeyed.com did :)
- Chuq
Although maybe you don't need the traffic, what I do on my sites is I use a PHP script and mod_rewrite to dynamically add a watermark (my site's URL) to the bottom of each picture without perminantly modifying the actual picture itself. Their might be a way to write a script that only watermarks it if it's not being displayed on your domain, but I couldn't (easily) find a way. That way, it basically becomes free banner adverts across the 'net.
What you should do is to whitelist everyone who has accessed it already -- this will no doubt include the offending deeplinker. Then when people start complaining to the deep linker about tubgirl or what not, they'll check and see nothing wrong. People will get upset that the deeplinker is both linking to a horrible image, AND denying it.
should be quite fun.