htpasswd password protected directory 404 Error

Home Forums BulletProof Security Pro htpasswd password protected directory 404 Error

This topic contains 3 replies, has 2 voices, and was last updated by  AITpro Admin 6 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2296

    Jan Wessels
    Participant

    Hi,
    I tried to secure a non-wp folder with htpasswd and htacces but when I access the url to this folder I do not get a login request for this folder.
    Instead I get a 404 not found error. Do I have to make an adjustment in Bulletproof to make this work?

    #2308

    AITpro Admin
    Keymaster

    What is the folder structure and .htaccess files related to your folder structure?

    Example:
    My WordPress site is a root installation here:  /website-root-folder or my site is a subfolder installation /my-wordpress-site-subfolder.
    My password protected folder is here:  /some-folder
    htaccess files related to this structure are:
    There is an .htaccess file is in the website root folder which affects subfolders recursively so it will affect and/or override my password protected directory .htaccess file.

    This is the most common problem scenario above and to fix problems with password protected .htaccess file is to add ErrorDocument 401 default to your root .htaccess file.

    ErrorDocument 400 /wp-content/plugins/bulletproof-security/400.php
    ErrorDocument 401 default
    ErrorDocument 403 /wp-content/plugins/bulletproof-security/403.php
    ErrorDocument 404 /404.php
    #2312

    Jan Wessels
    Participant

    Hi,
    Perfect! After putting the ErrorDocument 401 in the root htaccess the login appears as it should.
    Thanks for the swift solution.

    #2323

    AITpro Admin
    Keymaster

    Great!  Thanks for confirming that this took care of the issue.

    This code will be a permanent code addition in the next version release of BPS.  I keep meaning to add this to the autoupdate .htaccess function, but it tends to get forgotten.  😉  The autoupdate will check to see if this code already exists.  If it does not then it will be automatically added so in your case since you already added it then the autoupdate function will not add it again to your root .htaccess file.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.