1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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 Active Member

    Messages:
    82
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    50
    #2
    Try this:

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

    Bruno Fabian Member

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #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 :

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

    dineshsingh1984 Member

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