SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru GamerZ's Avatar
    Join Date
    Nov 2001
    Location
    Singapore
    Posts
    617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prevent Files From Being Access Directly (htaccess)

    Hi guys, I would like to prevent people for downloading files straight from a folder (lets pretend they are smart and they guess the files). The only way to download the file is through a script.

    I am thinking of putting the below htaccess file to the folder where it contains the file. Is my htaccess correct?
    AuthUserFile /dev/null
    AuthGroupFile /dev/null
    AuthName "Locked!"
    AuthType Basic

    require valid-user

    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>
    Thank you!

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,692
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    GZ,

    Actually, I think I'd just go
    Code:
    <Files ~ ".*\..*">
    order allow,deny
    deny from all
    </Files>
    and prohibit all access via the Internet (although PHP could access these files on the server side).

    Okay, NOT TESTED but I'd try that first.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Guru GamerZ's Avatar
    Join Date
    Nov 2001
    Location
    Singapore
    Posts
    617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THANK YOU, I will try


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •