Results 1 to 2 of 2

Thread: .htaccess deny access to all but one file

  1. #1
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default .htaccess deny access to all but one file

    I have an .htaccess file in a subfolder of my site.

    Currently its contents are set to "deny from all" but I want to access one known .txt file directly from that subfolder while continuing to block the rest.

    Please could somebody advise how to just allow access to this one file?

    Also, can the path to this one file in the .htaccess file be relative?

    Thanks in advance.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Never mind - I sussed it;

    Code:
         Order Deny,Allow 
         Deny from All 
     
    <Files "view_only_this_file.txt"> 
         Order Deny,Allow 
         Allow from All 
    </Files>
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

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
  •