Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    htaccess deny access to files/directories?

    I have files on my server that I don't want people to access. such as the /template directory which contains .tpl files. How would I deny access from all the files in this directory and the directory itself and display a page such as the error 404 method?

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    If the files are being called from the server and not the client, you can put this .htaccess rule in the directory you'd like to keep private:

    Code:
    <FilesMatch "...">
      Order deny,allow
      Deny from all
    </FilesMatch>
    Also, this isn't an HTML/CSS question. Moving to General Web…

  • #3
    New Coder
    Join Date
    Jan 2008
    Posts
    63
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Or you could move the folders out of the web-accessible directory. Or put a password on them with .htaccess.
    Web hosting by coders, for coders: php hosting - Magento eCommerce hosting - perl hosting - check us out!


  •  

    Posting Permissions

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