.htaccess how to make / handle as index.php?

Discussion in 'Apache' started by patlatyj, Mar 8, 2008.

  1. #1
    Hello! I need to restrict access (with htpasswd) to all my www folder, except index.php. So I use
    AuthName "Restricted Area" 
    AuthType Basic 
    AuthUserFile "E:\xampp\htdocs\.htpasswd"
    require valid-user
    
    <Files index.php>
    	Allow from All
    	Satisfy Any
    </Files>
    Code (markup):
    So authorisation is working great - I really need to enter my pass when querying for localhost/somefile.php and don't need to when accessing index.php, but if I try just http://localhost (which is handled by index.php without such a .htaccess) - I still get password prompt :( What could I do to make localhost/ and localhost/?v available w/o authorization? :confused: TIA!
     
    patlatyj, Mar 8, 2008 IP
  2. kulinar

    kulinar Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Restriction is for directories, not for files. index.php is in your root directory.

    In your case, you have to make the login in your root directory by PHP.
     
    kulinar, Mar 10, 2008 IP