Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I block someone from linking to my pictures 3

Status
Not open for further replies.

vincentw56

IS-IT--Management
Oct 10, 2002
47
US
This may not be the right area. How can I block someone from linking to my pictures or files on my website? I don't care if they take the pictures or files, but why should they use my bandwidth for there own use. Anyone have a suggestion? I am thinking of adding a watermark to the pictures, but really don't want to do that.

Thanks,
Vincent
 
Ah, bandwidth theft is a hideous thing.

You can't prevent it per se, but you can make it more pain than it's worth for the thieves.

I wrote a small script that did a mass-change to my HTML and filenames such that once a month, I could simply break their links.

My inner psychopath really wanted to mess with these theives, so I briefly considered replacing my old images with hardcore naughtiness (and then complaining to whoever was hosting the thief's site!), so that all those teenyboppers stealing my icons for their livejournals would suddenly find themselves target of a Strong Letter of Disapproval from their hosts, if not bounced from their accounts. Heh-heh.

Eventually, I used a "This image stolen from..." graphic. I used a nice big graphic, but I built it very cleanly and used GIF compression to make it small. So, for those people who steal from me, suddenly their li'l icon has turned into a huge "This graphic stolen from..." image. Then I wrote to their SysAdmins anyway, complaining.

I considered a couple of different options, but the fact is, people can grab an image if they can see it, so rather than prevent theft, I tried to make it... unpalatable.

This also required that I do a pass through my files once every six months or so, to catch the buggers.

By the way, watermarking won't really do a thing. If you only have a few files, just diddle your code once every couple of months. I fyou have many files, or have a db serving pages, then just reprogram things once in a while.

Hope that helps!

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Geez Edward, anyone ever accused you of being a control freak? ;-) j/k I know exactly how you feel.

Vincent, if you are running apache then you can use htaccess and it only takes a few minutes. What's your http server?



<?legalstuff
The above is my opinion only and should not be construed as the opinion of my employer.
?>
 
As IIIBradIII will surely explain for Apache, the most surefire way is to do it on the server, only serving images to users who have the correct HTTP_REFERER (that is, the image was requested by a page or link on your site). That's how the free hosting places do it.
 
A star to Edward! I'm not creative enough yet to build images people would want to steal. But when I am one day, I'm going to implement the idea using the adult pictures.

Cheers to Edward's psychopathic side!
 
If you have some server technology on your site you may want to read this article and transform the code to the application server your ISP is running.


The tutorial is intended for ColdFusion however the idea is what matters here. If you have some other means. ASP, PHP, JSP try to implement the same basic concept.

EMartinIII:
Some legal stuff you were going to be involved.
Even though you weren't going to show the naughty pics in your pages you were going to use your ISP's physical space to hold such pictures, therefore a complaint against whoever was stealing your pictures and bandwidth would have ultimately ended being a legal problem for you, since you were the &quot;provider&quot; of such images.
interesting idea though. :p


grtfercho çB^]\..
&quot;Imagination is more important than Knowledge&quot; A. Einstein
 
grtfercho: Even though you weren't going to show the naughty pics in your pages you were going to use your ISP's physical space to hold such pictures, therefore a complaint against whoever was stealing your pictures and bandwidth would have ultimately ended being a legal problem for you, since you were the &quot;provider&quot; of such images.

Noted. Then I'll stick with the warning GIF, or at least make the naughty things stick figures. ;)

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
can't you use a redirect option on an image with Apache? And redirect to a naughty pictures on an xxx site?

Gary Haran
==========================
 
Ooooooh, I must investigate that. Yeah, like an alias, right?

curious,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
That would require PHP of course...
But similar things can indeed be accomplished using other means (cgi, Java, Perl, whatever).

If the request comes from an invalid source, you can send something else instead (but be polite to avoid lawsuits), a small image saying &quot;hotlinking to images at not allowed&quot; is common.

Be sure to generate the images dynamically and not just redirect to the actual location as that would be easy to circumvent (an HTTP request forward would be harder to work around for the thief as that way you're not giving him the URI of the actual image at all).
 
if you have access to your .htaccess file (assuming you even have one), you can deal with it from there by placing the following in your .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteRule .(gif|jpg)$ - [F]

Replace domain.com with your domain name

There's always a better way...
 
tviman, I believe I do have access to my .htaccess file (as well as .csrhc, etc.).

Would you mind going through your listing line-by-line and explaining it? I want to understand this!

Thanks!

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Edward,
just copy and paste tviman's code and replace domain.com with your server name.
Place in the root directory to affect the whole site or else just in a sub-dir to effect that directory (and dirs below it)

The code posted causes a broken image to be displayed. You can change the last line to:

RewriteRule \.(gif|jpg)$ [R,L]

to actually replace the picture with one of your own.





 
xutopia,

Can apache handle asp pages without installing anyting new for it?

Thought not ^_^


I use both, and there are pros and cons for both. And they are about the same amt of pros and cons.
 
WizyWyg,

With the amount of patches out there for IIS, can it handle ASP as well as Apache?

Sorry, but Xutopia did not start this, I did and I still stand by the fact that Apache requires a lot less downloads (read one) to run any language that IIS does.

Sure, it may not run exactly the same but where do you draw the line between security and functionality?

Do you go with IIS simply because it comes with Windows so surely it must be as safe as can be. [LOL]

In your own words, I though not. [wink]

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top