Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541

    Auth htpasswd... on a file?

    is it possible to set Auth .htpasswd if a specific file and not the directory. example admin access http://www.site.com/sec/viewer.php and a Auth User/Pass window appears. I need for /sec/ to be unprotected for image loading so a complete directory protection is not an option.

  2. #2
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    414
    This should work for you:

    Code:
    <FilesMatch "viewer.php">
    [add authname, authtype etc here.]
    </FilesMatch>

  3. #3
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by Sam Robertson View Post
    This should work for you:

    Code:
    <FilesMatch "viewer.php">
    [add authname, authtype etc here.]
    </FilesMatch>
    i just added this inside the .htaccess and no luck. the htaccess is located in the same folder and viewer.php
    Code:
    <FilesMatch "viewer.php">
    AuthName "Invalid Section!"
    
    AuthType Basic
    require valid-user
    AuthUserFile "/home/site/.htpasswds/public_html/admin/passwd"
    </FilesMatch>

  4. #4
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    i got it to work i have an extra AuthName inside my .htaccess

Posting Permissions

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