WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 3 WordPress Installs - 2 Password Protected! HELP! :) (3 posts)

  1. Amy
    Member
    Posted 2 years ago #

    Ok here is the skinny. I have been at this for 3 hours today alone.

    LINK TO SITE IN QUESTION: http://macdds.org

    I have 3 wordpress installs on one domain.
    2 of them are password protected directories.

    I have been through numerous efforts with the .htaccess and have come up with somewhat of a solution using this thread:
    http://www.webmasterworld.com/apache/3688208.htm

    Basically, I have this for the root .htacess:

    RewriteEngine on
    # BEGIN WordPress (modified)
    RewriteCond %{REQUEST_URI} !^/tcm/
    RewriteCond %{REQUEST_URI} !^/members/
    # and requested URL_path does not resolve to existing file
    RewriteCond %{REQUEST_FILENAME} !-f
    # and requested URL-path does not resolve to existing directory
    RewriteCond %{REQUEST_FILENAME} !-d
    # rewrite the request to WordPress
    RewriteRule . /index.php [L]
    # END WordPress

    Then in the password protected subdirectory for the TCM LOGIN, I have this for the .htaccess:

    ErrorDocument 401 /tcm/401.html
    AuthType Basic
    AuthName "TCM Only"
    AuthUserFile "/home/USERNAME/.htpasswds/public_html/tcm/passwd"
    require valid-user

    For the password protected subdirectory for the MEMBER LOGIN, I have this for the .htaccess:

    ErrorDocument 401 /members/401.html
    AuthType Basic
    AuthName "Members Only"
    AuthUserFile "/home/USERNAME/.htpasswds/public_html/members/passwd"
    require valid-user

    All this works pretty good, as long as permalinks are on Default, and not the Month and name. Which I am ok with using the Default permalinks.

    The problem is that every time you click into the TCM LOGIN it prompts several times for the password and when you finally get in everything displays fine, but if I try to navigate with in the site it again prompts me with each navigational click I make!

    The funny thing is that the MEMBERS ONLY Area works PERFECT! But the TCM Area keeps getting hung up. It won't even store my password through the browser, so I have to type it each time. It is like something is just not catching properly.

    Also, on the end of the links to the subdirectories I did put in the trailing slashes, as I have read that can lead to having to enter in your user and password twice. But this is more than just two times, actually it varies with each time.

    If it is not even possible to have to 2 separate wordpress installs be password protected, someone please just tell me now so I can figure something else out. I am on my last thread with this. I would use the regular wordpress user subscription logins, but the customer will not want this. They want 1 main user and 1 password.

    Any help is GREATLY appreciated. Thanks so much for taking the time to read this.

    - Amy

  2. MickeyRoush
    Member
    Posted 2 years ago #

    I'm not familiar with your set up. But if I was going to try and password protect those 'sub directories', the .htaccess files that would be placed in each, would look like this (no quotation marks are needed in AuthUserFile, quotation marks are only used in the AuthName to show what will be displayed, I believe):

    ErrorDocument 401 /tcm/401.html
    AuthType Basic
    AuthName "Warning: This is restricted for TCM Only"
    AuthUserFile /your/path/to/.htpasswd
    require valid-user

    You could also try this:

    ErrorDocument 401 /tcm/401.html
    AuthType Basic
    AuthName "Warning: This is restricted for TCM Only"
    AuthUserFile /your/path/to/.htpasswd
    <Limit GET>
    require valid-user
    </Limit>
  3. Amy
    Member
    Posted 2 years ago #

    THANK YOU SOOOOOO MUCH MickeyRoush...that looks to have solved the problem, for now ;) Hope it doesn't decide to go and break itself mysteriously in the future. If so, I will be back!

    I used your second recommendation and put the below into the .htaccess file for the TCM Login / TCM directory:

    ErrorDocument 401 /tcm/401.html
    AuthType Basic
    AuthName "TCM Only"
    AuthUserFile /home/USERNAME/.htpasswds/public_html/tcm/passwd
    <Limit GET>
    require valid-user
    </Limit>

    I can't even give you enough thanks!

    - Amy

Topic Closed

This topic has been closed to new replies.

About this Topic