Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 06-17-2004, 09:46 AM   #1 (permalink)
Huggles, sir?
 
seretogis's Avatar
 
Location: Seattle
[mod_rewrite] Defeating image hot-linking

I've been looking around for the most efficient way to do this and I've learned how to deny access to linked files on my site, but replacing requests with a "denied" image is proving to be more of a pain in the ass.

Here's what I'm using:

Code:
Rewriteengine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://seretogis.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seretogis.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://wrath.seretogis.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://word.seretogis.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://pwned.inf7.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.inf7.net/.*$ [NC]
RewriteRule .*\.(jpg|doc|txt|gif|bmp|jpeg|png)$ http://www.seretogis.org/files/linkables/dontlinkme.jpg [R,NC]
And here is a linked image so you can see what happens:
--

Any ideas what may be the problem?
__________________
seretogis - sieg heil
perfect little dream the kind that hurts the most, forgot how it feels well almost
no one to blame always the same, open my eyes wake up in flames
seretogis is offline  
Old 06-17-2004, 02:59 PM   #2 (permalink)
Banned
 
cthulu23's Avatar
 
You've set up an infinite loop as the redirection url meets the redirection reqirements.

Edit: There is a built in safety check in Apache, but it is sensitive to slashes and other special characters. Maybe try giving the relative path to the jpg and don't start the path with a "/"...maybe something like "files/linkables/dontlinkme.jpg"

2nd edit: You also might need to use ReWriteBase in this case.

Last edited by cthulu23; 06-17-2004 at 03:30 PM..
cthulu23 is offline  
Old 06-17-2004, 05:50 PM   #3 (permalink)
Please touch this.
 
Halx's Avatar
 
Owner/Admin
Location: Manhattan
I just visit http://www.htmlbasix.com for their code generator
__________________
You have found this post informative.
-The Administrator
[Don't Feed The Animals]
Halx is offline  
Old 06-17-2004, 09:32 PM   #4 (permalink)
Huggles, sir?
 
seretogis's Avatar
 
Location: Seattle
Quote:
Originally posted by cthulu23
You've set up an infinite loop as the redirection url meets the redirection reqirements.
Yes, this was the problem! I simply renamed the dontlinkme.jpg file to dontlinkme.jpe and changed it appropriately in the .htaccess and it works like a charm. Many thanks!
__________________
seretogis - sieg heil
perfect little dream the kind that hurts the most, forgot how it feels well almost
no one to blame always the same, open my eyes wake up in flames
seretogis is offline  
 

Tags
defeating, hotlinking, image, modrewrite


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 07:49 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62