Question about .htacces

Discussion in 'HTML' started by Thomas Wehner, Oct 20, 2004.

  1. 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
    Thomas Wehner, Oct 20, 2004
    #1
    1. Advertising

  2. Thomas Wehner

    brucie Guest

    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
    brucie, Oct 20, 2004
    #2
    1. Advertising

  3. Thomas Wehner

    Toby Inkster Guest

    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
    Toby Inkster, Oct 20, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sean
    Replies:
    1
    Views:
    577
    Cowboy \(Gregory A. Beamer\)
    Oct 20, 2003
  2. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Quick Question - Newby Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    639
    Iain Norman
    Feb 16, 2005
  3. =?Utf-8?B?YW5kcmV3MDA3?=

    question row filter (more of sql query question)

    =?Utf-8?B?YW5kcmV3MDA3?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    933
    Scott Allen
    Oct 6, 2005
  4. Philip Meyer
    Replies:
    0
    Views:
    407
    Philip Meyer
    Nov 30, 2003
  5. Bit Byte
    Replies:
    1
    Views:
    823
    Teemu Keiski
    Jan 28, 2007
Loading...

Share This Page