Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion

Go Back   Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion > Interests > Tilted Technology

Reply
 
LinkBack Thread Tools
Old 06-17-2004, 11:46 AM   #1 (permalink)
Huggles, sir?
 
seretogis's Avatar
 
Join Date: May 2003
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   Reply With Quote
Old 06-17-2004, 04:59 PM   #2 (permalink)
Banned
 
cthulu23's Avatar
 
Join Date: Apr 2003
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 05:30 PM.
cthulu23 is offline   Reply With Quote
Old 06-17-2004, 07:50 PM   #3 (permalink)
Please touch this.
 
Halx's Avatar
 
Owner/Admin
Join Date: Jan 2002
Location: Manhattan
I just visit http://www.htmlbasix.com for their code generator
__________________
- Hal(x)
"But suppose everybody on our side felt that way."
"Then I'd certainly be a damned fool to feel any other way. Wouldn't I?"
[Read Me]
Halx is offline   Reply With Quote
Old 06-17-2004, 11:32 PM   #4 (permalink)
Huggles, sir?
 
seretogis's Avatar
 
Join Date: May 2003
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   Reply With Quote
Reply

Bookmarks

Tags
defeating, hotlinking, image, modrewrite

Thread Tools

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
Forum Jump


All times are GMT -7. The time now is 07:06 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
All text (c) 2002-2008 Tilted Forum Project
"Insignia" vBulletin 3.5 - b6gm6n - x7x7x7.com