HTAccess Allow URL?

Discussion in 'Apache' started by erichamby, Oct 17, 2010.

  1. #1
    I have my downloads in a folder and want to allow only users from a url to download them. can this be done with htaccess?

    So if the users place the file url in the addess bar it wonr let them download. but if they go to since83.com and click the download link it allows it.
     
    erichamby, Oct 17, 2010 IP
  2. elicitservers

    elicitservers Peon

    Messages:
    714
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You could try this, should work, placing it in the folder where your downloads are located:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !([url]www.)?domain.com/url-of-download-link[/url]
    RewriteRule .* - [F]
    Code (markup):
     
    elicitservers, Oct 17, 2010 IP
  3. erichamby

    erichamby Member

    Messages:
    256
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #3
    will i need to do this for every download link? i have over 600. Or can i just put like "since83.com" has the url it should accept.
     
    erichamby, Oct 17, 2010 IP
  4. scriptinstaller

    scriptinstaller Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    referer is not reliable, just so you know, it can be forged
     
    scriptinstaller, Oct 24, 2010 IP