Problem protecting multiple folders

Discussion in 'Setting-up protection' started by corygrunk, Jun 3, 2008.

  1. corygrunk

    corygrunk New Member

    Joined:
    Jun 3, 2008
    Messages:
    1
    I have a folder named "members" which houses a Wordpress installation and our podcast files. I need everything in this folder to be protected. I've set up aMember protection on the "members" folder using new_rewrite. I can successfully log into the homepage of the WP install, but when I click on any other page, I get a 404 and 500 error. It appears that whenever the URL looks like its in another folder (such as http://sample.com/members/new_page/) I get the error. Since these URLs are generated by WP, I can't specify protection on them, but I would assume since everything is in the protected folder "members", enverything would be protected. Any thoughts?
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Yes the directories are protected, but rewrite rules are going to prevent you from browsing to them.

    You need to adjust your .htaccess rules to exclude those directories and ensure a local .htaccess exists in each of the directories you are trying to protect.
  3. matthewebel

    matthewebel Minister of Piano Rock

    Joined:
    Jul 13, 2008
    Messages:
    22
    BINGO! I found a solution at http://drupal.org/node/64708#comment-1451212

    All you have to do is add an error message to the PROTECTED directory's .htaccess file:
    ErrorDocument 401 "Unauthorized"

    I don't know what voodoo is taking place here, but it makes WordPress (or any other permalink rewrite scheme) actually recognize that directory as a directory, not as a 404.
  4. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    @matthewebel, thanks for sharing. What the end result (ie. what the before and after behavior when making the change you are suggesting?)

Share This Page