Skip to main content

Issue with .htaccess files and Wordpress

Comments

8 comments

  • NOC_Serverpoint
    Hi, The issue is because a protected directory's subdirectories inherit their parent directory's password protection. The lock iconindicates that Directory Privacy configurations already exist for that directory. Please have a look at this article: - Directory Privacy - Version 60 Documentation - cPanel Documentation - Regards,
    0
  • elpaulli
    I am not sure I follow. I have no password protection on the main directory, in this case it is the www file. And then the folder in the www - is the one with a lock on it. Sorry, am new to server admin, and trying to figure this out as I go.
    0
  • 24x7server
    And then the folder in the www - is the one with a lock on it.

    You mean to say that you have given the lock on "www" folder? the folder www is linked to public_html directory, so it has lock, then your main site has been locked too.
    0
  • elpaulli
    Sorry -- no I have not given a lock to the www or the public_html directory. The lock was placed on a sub-directory in the public_html file.
    0
  • linux4me2
    What I've done to fix this in the past is to put the following in the password-protected subfolder's .htaccess file before the entries regarding password protection:
    ErrorDocument 401 /401.html
    Next, create a 401.html in the main (/public_html) folder, with any text, for example:
    PASSWORD PROTECTED FOLDER - Please enter the correct username/password.
    That should allow you to access the password-protected subfolder(s) without getting the 404 on your WordPress site.
    0
  • elpaulli
    Thanks! This worked perfectly. Is there a reason why this happens? Just trying to understand the mechanics behind the fix for future issues if they arise.
    0
  • Infopro
    Thanks for updating your thread.
    0
  • linux4me2
    All I have in my notes to explain why the issue happens with WordPress is that there is a conflict between WordPress' rewrite rule so that it handles all 404 errors in its directory tree and how Apache handles the password-protected folders. Fortunately, the fix above works. Someone else here may be able to explain more.
    0

Please sign in to leave a comment.