How can I access a password protected directory when htaccess redirects to 404? How can I access a password protected directory when htaccess redirects to 404? wordpress wordpress

How can I access a password protected directory when htaccess redirects to 404?


I was having the same problem and this worked for me: http://support.aiso.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=246

Just switch the 401 Error Document line to read:ErrorDocument 401 default


The 404 is from not having "401" Error document - one is specified by default with cpanel but not usually not set up by the host. I created a blank document and added this to my .htaccess:

ErrorDocument 401 /empty.html

I did this to protect my wp-admin folder from future/unknown Wordpress exploits after someone defaced my site.


I had this same problem under cPanel. In my case it was due to the "~/.htpasswds/public_html/secure-dir/passwd" file/directory not having the correct permissions. I called the hosting company and they chown'd the file with the correct permissions and it worked.

It really had me stumped in that it looked like the directory protection was working b/c it was popping up the AUTH window. But when Apache went to verify the passwd it would choke and serve the WP standard 404 page.