PDA

View Full Version : Stealing Bandwidth


Patrick
09-07-1999, 01:15 PM
Looking for the best way to protect my site from images on html being linked to other sites.
Came across this:

Here's all you have to do to make use of this feature: put a file named ".htaccess" in any directory on your site. Any attempt to access any file in that directory will invoke the rules contained in the file. If the referring URL is not listed in the file, the "RewriteRule" page will be sent instead.

[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] A sample .htaccess file:

[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] AuthUserFile /dev/null
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] AuthGroupFile /dev/null
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] RewriteEngine On
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] RewriteCond %{HTTP_REFERER} !=http://fred.com/main.htm
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] RewriteCond %{HTTP_REFERER} !=http://wilma.com/main.htm
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp] RewriteRule /* http://fred.com/hotlink.htm [R,L]

This limits access to the files within to the two "RewriteCond" URLs specified. If any other URLs try to access any file in the directory, http://fred.com/hotlink.htm is delivered instead.

Will this work with FutureQuest and my WHOLE web site?
Can the "RewriteCond %{HTTP_REFERER} !=http://fred.com/main.htm" just be http://www.foreverkate.com and everything on my site will be protected.

Thanks for any help on this subject, or should I say project.

Patrick
http://www.foreverkate.com

Terra
09-07-1999, 01:44 PM
With the complexities of mod_rewrite, FutureQuest cannot provide any direct support for this modules usage whatsoever...[nbsp][nbsp]You are on your own to enlighten yourself via the documentation and heed all the precautions of owning this Uzi...

Be forewarned, test your rewrites ***VERY*** carefully and completely![nbsp][nbsp]It is also recommended for you to 'tail -f' your logs and watch it's behavior while developing...[nbsp][nbsp]I have had to disable several domains so far using mod_rewrite and getting themselves into either a )deeply nested recursive loop or )never ending loop...

I will not disallow the usage of mod_rewrite nor discourage it, it is available for those that feel they have the knowledge and capability to wield this extrememly powerful weapon...

For those that are not confident, or understand the underlying nature of Apache and URI rewriting, stay far away from this module, or an amputation may be the final result... :D

--
Terra
--Do you feel the force Luke?--
FutureQuest

Patrick
09-07-1999, 02:34 PM
I guess you mean it's not a good idea.

------------------
Patrick
www.foreverkate.com (http://www.foreverkate.com)