News:

Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

I need some help

Started by Whipsound, December 23, 2005, 12:30:56 AM

Previous topic - Next topic

Whipsound

I realise people are starting to steal my images. I'm not concerned about my bandwidth - I just don't really like people doing it. I saw some sites use a script where when someone hotlinks an image from a site this banner comes up saying "You have stolen from "thisite". Would anyone know where I could find a script like this to prevent people stealing my images?

Thanks.

Ben

http://altlab.com/htaccess_tutorial.html

This tells how to create a .htaccess file to stop hotlinking. :-)
--Ben
Ben@freepgs.com

webzone (archived)

A code to prevent hotlinking has already been posted a few weeks ago.

Here it is :
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?freepgs.com/webzone(/.*)?)?$ [NC]
RewriteRule \.(gif|jpg|png)$ / [F,L]


Simply change the RewriteCond line to match your website address and put this inside your .htaccess inside your root directory (ftp.freepgs.com) or inside /httpdocs (plesk.lvcs.net). It should return a "403 - Forbidden" error when an external site uses your images (.gif, .jpg, .png).

Whipsound

Ergg, that just made all the images on my site go and I got a server error. That wasn't exaclty what I wanted.

Whipsound

That external error appears on my site as well? How can I change this :/

webzone (archived)

#5
QuoteErgg, that just made all the images on my site go and I got a server error.

Server Error means that Apache does not understand your .htaccess code. You have certainly made a mistake somewhere when copying this code, as I already tested it on two accounts and got no errors.

Could you copy the contents of .htaccess and post it here?

webzone (archived)

[NC needs a closing bracket like [NC]

Whipsound

Ok well the site works now - exept all the images are gone broken :/

webzone (archived)

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?habbo-hood\.com/dir(/.*)?)?$ [NC]
RewriteRule \.(gif|jpe?g|bmp|png)$ / [F,L]


The code right above should work properly on your site. Could you try?

Whipsound

That just makes the images broken on my site. Take a look
habbo-hood.com

Whipsound

I just realised that the .PNG images only work...

webzone (archived)

All works for me... I can see your images on your front page but I can't hotlink them.

Try to clean up your browser cache.

webzone (archived)

Forget about my comment, I tested in Opera without sending the referer header. I'm awfully sorry.

I just realised : you don't have a /dir/ directory on your site, but you require it to be present in the referer header. You may be luckier with this code :

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?habbo-hood\.com(/.*)?)?$ [NC]
RewriteRule \.(gif|jpe?g|bmp|png)$ / [F,L]

Whipsound

Ahhh thats it! Now is there a way where if someone stole an image a image on their site will appear saying " Don't Steal" or something like that?

Whipsound

Figured it out. No need to help me. Thanks a lot! Your a big help !