htaccess login authentication

Discussion in 'PHP' started by dineshsingh1984, Dec 17, 2013.

  1. #1
    I'm working this proj. on localhost
    and my localhost path is :
    I:\xampp\htdocs\my_proj

    I'm add this code in .htaccess file

    AuthName “Restricted Area”
    AuthType Basic
    AuthUserFile /my_proj/.htpasswd
    AuthGroupFile /dev/null
    require valid-user


    and add this code in .htpasswd file
    admin:$apr1$gs0j3ctm$NICQOA7ANxOajPQcRVZA3.

    when i run my site on localhost then show login popup
    but after login show error :
    //Server error!
    //The server encountered an internal error and was unable to complete your request. Either //the server is overloaded or there was an error in a CGI script.

    //If you think this is a server error, please contact the .

    //Error 500


    please help me.................
     
    dineshsingh1984, Dec 17, 2013 IP
  2. Andrei_RO

    Andrei_RO Well-Known Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Try this:

    AuthName “Restricted Area”
    AuthType Basic
    AuthUserFile I:/xampp/htdocs/my_proj/.htpasswd
    require valid-user
    Code (markup):
    without AuthGroupFile
     
    Andrei_RO, Dec 17, 2013 IP
  3. Bruno Fabian

    Bruno Fabian Well-Known Member

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    113
    Digital Goods:
    1
    #3
    Hi there,

    This is because you need to specify the full path on the disk for AuthUserFile, so for example if you have I:/xampp/htdocs/my_proj/ then you will have :

    AuthType Basic
    AuthName "Restricted Area"
    AuthUserFile I:/xampp/htdocs/my_proj/.htpasswd
    Require valid-user
    Code (markup):
     
    Bruno Fabian, Dec 17, 2013 IP
  4. dineshsingh1984

    dineshsingh1984 Active Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    thanks for reply...............
     
    dineshsingh1984, Dec 17, 2013 IP