disallow access by extension?

Discussion in 'Apache' started by iaw4, Oct 21, 2007.

  1. #1
    dear apache experts:

    I have some files with specific extensions, say files ending with .password, that should live in my hierarchy, but never be served up by apache2 under any circumstances. is there an obvious way to do this, other than telling apache that there are executable, which means that apache will flunk when it tries to actually execute them?

    help appreciated.

    /iaw
     
    iaw4, Oct 21, 2007 IP
  2. jmhyer123

    jmhyer123 Peon

    Messages:
    542
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    in your .htaccess file use

    
    <Files *.EXTENSION>
    order allow,deny
    deny from all
    </Files>
    
    Code (markup):
    That will prevent all access to any file with the extension(s) specified.

    Hope that helps ;)
     
    jmhyer123, Oct 21, 2007 IP