WEB HTACCESS help... prevent direct file linking.

Discussion in 'OT Technology' started by brds, Feb 16, 2010.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,645
    Likes Received:
    15
    Location:
    Atlanta
    I'm looking to try to edit the htaccess so that if a user goes to www.sites.com/files/thisfile.exe, they wont be able to download thisfile.exe. Instead, I want to make sure that the referring page is www.sites.com/files/ before granting access.

    Is this possible?
     
  2. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,645
    Likes Received:
    15
    Location:
    Atlanta
    c'mon ngrs :mad:



    :love:
     
  3. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
    RewriteRule \.(gif|jpg|js|css)$ - [F]
     
  4. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Really need a sticky in this forum teaching people how to use google
     
  5. Mikenotmike

    Mikenotmike

    Joined:
    Jun 1, 2001
    Messages:
    6,244
    Likes Received:
    0
    Location:
    USA
    almost every single problem could be solved with google and enough time, with that logic we should consider just deleting the sub forum
     
  6. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Yes, but not all threads in here can be answered by typing the thread title into google. Think this subforum is justified for plenty of advice and issues that can't easily be articulated into a google search
     
  7. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,645
    Likes Received:
    15
    Location:
    Atlanta
    I looked on google but when you dont know exactly what you're looking for is called, its kinda tough. I tried looking, promise :wtc:
     
  8. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    True THAT. I always look first though. Try not to bother people too much with my shit.
     

Share This Page