• Resolved snoogly

    (@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 https://sitename.com, and the second time for https://www.sitename.com

    I have no idea why this is the case!

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

    (@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.]

    Thread Starter snoogly

    (@snoogly)

    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

    (@macmanx)

    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.

    Thread Starter snoogly

    (@snoogly)

    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!

    Thread Starter snoogly

    (@snoogly)

    All is well now. With the help of my hosting company (Dreamhost) I changed a setting in the CP to automatically redirect any ‘https://www……’ arrivals at the site to ‘https://…’ address. The htacces file was seeing ‘https://www.sitename.com’ and ‘https://sitename.com’ 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. https://tomballcountryclub.org/forum/index.php
    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: https://tomballcountryclub.org/forum/index.php (include the index.php and leave off the www.)
    2. In the WordPress Options for Blog address (URI) specify https://tomballcountryclub.org/forum/index.php (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 https://yoursite.com/protected_directory to https://yoursite.com/protected_directory/). Hope it helps.

    The problem is really with http authentication.
    When you request https://domain.com and provide a userid/password it’s for that url only.
    https://joe.domain.com 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.