Solution

Re: Password Protected Directory Won't Prompt for Password - 404 Instead

Solution:

I have WordPress set up to pull from a sub-directory. 

Instead of nacsw.org/, it pulls from nacsw.org/sandbox

The index.php file re-routes the file locations so that my secure folder nacsw.org/memOnly

is being searched for at nacsw.org/sandbox/memOnly

Hence, the 404 error. 

 

I called GoDaddy again. This time, the tech actually wanted to help, unlike the one I talked to before. This helpful one disabled the index.php, and tried again. The password protection worked. He recommended that I move the protected file to the /sandbox folder.

 

Additional Step Needed is explained here: https://forums.cpanel.net/threads/issue-with-htaccess-files-and-wordpress.590907/ due to a conflict between cPanel .htaccess (on Apache) and Wordpress 404 handling.

  • Add a line to the .htaccess: 
    • ErrorDocument 401 /401.html
  • Create a file in your corresponding to the location you listed above: 401.html
    • The file can have any text:  
      PASSWORD PROTECTED FOLDER - Please enter the correct username/password.

Finally, it works!

-mw