Support » Fixing WordPress » Using .htaccess for protection, but asked for password twice.

  • Resolved snoogly


    I am using the .htaccess file to password protect the entire WP site. The htaccess file is located in the root WP directory, and for some reason visitors are asked twice, right after another, to enter the login name and password.

    I often use htaccess for password protection, but this is the first time I have experienced this behaviour. Is it a uniquely WP thing, or is there something wrong with my setup?

    On closer inspection I see that the first time I am asked for the password for, and the second time for

    I have no idea why this is the case!

Viewing 10 replies - 1 through 10 (of 10 total)
  • administrator


    no the problem is that your ****** . htaccess for pass prot is the ******** i have ever heard.

    if i ever hear this again i am going to ban you from the wordpress forums

    [Moderated – hey ‘administrator’, it’s not you carrying the big stick around here. I’ll type this slowly just for you:
    Get Lost.]



    What is the problem with htaccess? It’s a simple way to protect a WP site which doesn’t require users to log in.

    Moderator James Huff


    Halfelf Minion 🚀

    Snoogly, I don’t know who “administrator” is, but he holds no position of authority in these forums. He will not be banning you, or anyone else. But, if his behavior continues, the real administrators will ban both his username and IP.

    As for your issue, a link to your blog with a temporary password would help us to troubleshoot it. If that is not possible, please let us know.



    Thanks for that reassurance! I did think his response was a bit … over the top! I am waiting for my hosting company to get back to me, as it may a problem at their end. If I don’t hear anything in a few hours I will get back to you.

    Thanks again!



    All is well now. With the help of my hosting company (Dreamhost) I changed a setting in the CP to automatically redirect any ‘http://www……’ arrivals at the site to ‘http://…’ address. The htacces file was seeing ‘’ and ‘’ as two different addresses, and asked for a password to access each of them.

    Though WPress is not to blame for this, I have only ever had such an experience with a WPress site.

    I just had the same problem with my new site and found these comments helpful. If I use the following link I can get there with only one login.
    However, if I either leave off the “index.php” or inlude the “www”, I have to login twice.

    This has got to be a WordPress problem. If I specifically reference another file such as readme.html even using the “www” I get to it with only one login.

    I spoke too soon. I get asked for another login when I select another page on the site. It then inlvudes the “www”. I guess I’ll have to work with the host provider.

    I now have this working properly by doing the following:
    1. Link to the forum: (include the index.php and leave off the www.)
    2. In the WordPress Options for Blog address (URI) specify (include the index.php and leave off the www.)

    If anybody’s still interested, try setting up a redirect with the trailing slash. (redirect from to Hope it helps.

    The problem is really with http authentication.
    When you request and provide a userid/password it’s for that url only. is treated as something different and thus requiring a new login.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Using .htaccess for protection, but asked for password twice.’ is closed to new replies.