06-17-2004, 09:46 AM | #1 (permalink) |
Huggles, sir?
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] -- 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 |
06-17-2004, 02:59 PM | #2 (permalink) |
Banned
|
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.. |
06-17-2004, 05:50 PM | #3 (permalink) |
Please touch this.
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] |
06-17-2004, 09:32 PM | #4 (permalink) | |
Huggles, sir?
Location: Seattle
|
Quote:
__________________
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 |
|
Tags |
defeating, hotlinking, image, modrewrite |
|
|