FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: Whipsound on December 23, 2005, 12:30:56 AM

Title: I need some help
Post by: Whipsound on December 23, 2005, 12:30:56 AM
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.
Title: Re: I need some help
Post by: Ben on December 23, 2005, 01:02:51 AM
http://altlab.com/htaccess_tutorial.html

This tells how to create a .htaccess file to stop hotlinking. :-)
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 01:05:21 AM
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).
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 01:35:37 AM
Ergg, that just made all the images on my site go and I got a server error. That wasn't exaclty what I wanted.
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 01:44:30 AM
That external error appears on my site as well? How can I change this :/
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 01:49:55 AM
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?
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 02:18:48 AM
[NC needs a closing bracket like [NC]
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 02:20:16 AM
Ok well the site works now - exept all the images are gone broken :/
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 02:23:08 AM
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?
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 02:24:56 AM
That just makes the images broken on my site. Take a look
habbo-hood.com
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 02:27:18 AM
I just realised that the .PNG images only work...
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 02:28:15 AM
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.
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 02:30:54 AM
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]
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 02:33:32 AM
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?
Title: Re: I need some help
Post by: Whipsound on December 23, 2005, 02:35:36 AM
Figured it out. No need to help me. Thanks a lot! Your a big help !
Title: Re: I need some help
Post by: webzone (archived) on December 23, 2005, 02:37:59 AM
Quoteimage on their site will appear saying " Don't Steal" or something like that?

It is possible, but remember that this image will have a fixed size. When it will be displayed on the "other website", it might be distorted or unreadable if the stealer used height and width attributes.

QuoteThanks a lot! Your a big help !

You're welcome.