Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Question about .htacces

Reply
Thread Tools

Question about .htacces

 
 
Thomas Wehner
Guest
Posts: n/a
 
      10-20-2004
Hello,

i have a little problem with an .htacces file.

The conten ist the following:
--------------------------------------

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?deineHomepage\.de(/.*)?$ [NC]

RewriteRule \.(rar|zip)$ http://www.deineHomepage.de/images/geklaut.gif
[R,L]

------------------------------------

This Script helps protect links / files on webspace. If maybe www.xyz.de
links to an *.rar or *.zip file on my Webspace the user who wanted to
download this file is getting a message that he is not allowed to download,
because he didn't click a link to this file on my webpage.....

Now there is a little problem. If the User makes right click and is coping
the link and paste it into a new Browser Tab, the he is able to Downlaod my
file.

I think, it's because there is no HTTP_REFERER in an new Browser Window. Is
there any wayto change this, maybe if there is no Referer download is't
possible to.


THX
Thomas

PS: Please appologize my bad english


 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      10-20-2004
In alt.html Thomas Wehner said:

> [clasic hotlinking mod_rewrite]
> Now there is a little problem. If the User makes right click and is coping
> the link and paste it into a new Browser Tab, the he is able to Downlaod my
> file.


if you're worried about that then i had better not tell you the other
ways the rewrite doesn't work that are worse.

> I think, it's because there is no HTTP_REFERER in an new Browser Window.


many people don't even send a referer or its something interesting
totally unrelated to being a referer.

> Is there any wayto change this, maybe if there is no Referer download
> is't possible to.


remove this line:

RewriteCond %{HTTP_REFERER} !^$

--


v o i c e s
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      10-20-2004
Thomas Wehner wrote:

> Is there any wayto change this, maybe if there is no Referer download is't
> possible to.


Yes, but it's a dumb idea because it will block many legitimate accesses.
(e.g. user goes to your page, clicks on the link and his browser passes
the address to his download manager, which doesn't send a referer header.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments