homepage Welcome to WebmasterWorld Guest from 54.204.215.209
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
help with htaccess
htaccess help
jaccinc




msg:1516784
 8:27 am on Dec 12, 2002 (gmt 0)

I've recently put up a anti-leech code for my site but for some reason, the code is also preventing my visitors from right clicking and saving files. Is there anyway I can modify the code to allow right clicking and still have it function as an anti-leech script from other server?

This is the code I'm using.
RewriteEngine On
RewriteCond %{HTTP_REFERER}!^$ [NC]
RewriteCond %{HTTP_REFERER}!^http://website.com/ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.website.com/ [NC]
RewriteRule [^/]+.(jpeg¦jpg)$ - [F]

 

dagon




msg:1516785
 12:12 am on Dec 14, 2002 (gmt 0)

I use:

RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.domain.com/.*$ [NC]
RewriteRule .*\.(gif¦jpg)$ - [F]

users can still right click and download with out a problem

[edited by: DaveAtIFG at 12:50 am (utc) on Dec. 14, 2002]
[edit reason] Revised to generic URLs [/edit]

jdMorgan




msg:1516786
 12:29 am on Dec 14, 2002 (gmt 0)

This is a little faster, covers more image file types and the periods in the URL are escaped properly:

RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain\.com [NC]
RewriteRule .*\.(gif¦jpg¦jpeg?¦png)$ - [F]

Note: Replace all broken vertical pipe symbols "¦" with the one from your keyboard before use!

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved