Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Need image hot linking prevention help! (http://www.greenguysboard.com/board/showthread.php?t=21837)

ladydesigner 2005-07-10 02:07 PM

Need image hot linking prevention help!
 
I just noticed this site is hot linking some of my images (the first 6 images listed). http://www.my-journal.com/jrn/md__1/...dt__1120201200

I *thought* my .htaccess would prevent this. Can anyone take a look at what I'm using and tell me if there are any errors or if I need to add/delete something?

Thanks in advance!

Using this .htaccess in the root of the domain:

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.thefetishfiles.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://thefetishfiles.net*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://thefetishfiles.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://thefetishfiles.net*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://thefetishfiles.net:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.thefetishfiles.net:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://thefetishfiles.net:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.thefetishfiles.net:80.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*thefetishfiles\.net(:[0-9]+)?(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?1\.2\.3\.4(:[0-9]+)?(/.*)?$
RewriteRule .*\.(asf|mpg|mpeg|wmv|avi|rm|gif|jpeg|jpg|zip)$ - [NC,F,L]
ErrorDocument 400 http://www.thefetishfiles.net
ErrorDocument 401 http://www.thefetishfiles.net
ErrorDocument 403 http://www.thefetishfiles.net
ErrorDocument 404 http://www.thefetishfiles.net
ErrorDocument 501 http://www.thefetishfiles.net
ErrorDocument 502 http://www.thefetishfiles.net
ErrorDocument 503 http://www.thefetishfiles.net

cd34 2005-07-10 02:41 PM

are you sure? Your links show up as broken for me. If you have the images cached, they will show up, i.e. you looked at it, put in the rules, tried again -- you might need to clear the cache. Also, if you send an empty referrer, the image will show up as per your rules.

As a side note, the 1.2.3.4 is supposed to represent your IP address.

Code:

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*thefetishfiles\.net(:[0-9]+)?(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?209\.16\.200\.208(:[0-9]+)?(/.*)?$
RewriteRule .*\.(asf|mpg|mpeg|wmv|avi|rm|gif|jpeg|jpg|zip)$ - [NC,F,L]
ErrorDocument 400 http://www.thefetishfiles.net/
ErrorDocument 401 http://www.thefetishfiles.net/
ErrorDocument 403 http://www.thefetishfiles.net/
ErrorDocument 404 http://www.thefetishfiles.net/
ErrorDocument 501 http://www.thefetishfiles.net/
ErrorDocument 502 http://www.thefetishfiles.net/
ErrorDocument 503 http://www.thefetishfiles.net/

That's all you should need -- you've got two rulesets in there with one condition. Also, I added a / to the end of your error redirects just to save 1 301 redirect when the person is redirected.

Give that a try, it should do the trick.

ladydesigner 2005-07-10 03:08 PM

Thanks for the help. |thumb

I changed out the .htaccess file I was using for the shorter, revised one you did. I cleared my cache, deleted temp. internet files and restarted my computer and I still see the images being hot linked. :(

Does anyone else see the images or are they broken?

What does "send an empty referrer" mean? Does that mean I just go straight to the url without clicking on a link? I'm so technically challenged!

cd34 2005-07-10 03:34 PM

some privacy software (and hotlinkers) disable sending the referrer -- which would allow your rules to be bypassed.

I surf with the referrer on, and they are broken -- your ruleset allows people that aren't sending the referrer to see the images, which is generally the preferred behavior.


All times are GMT -4. The time now is 11:53 PM.

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