404 errors, WordPress 2 and password protected directories

Another day, another upgrade to WordPress which breaks my password protected pages with 404 errors I spent months trying to fix before and stupidly did not make a note of the link when I fixed it back in August.

Thankfully others have now found better solutions which should stop WordPress breaking on future upgrades. All you need to do is add the following to your .htaccess file:

ErrorDocument 401 /[path_to_file]/myerror.html
ErrorDocument 403 /[path_to_file]/myerror.html

(noting that the path and file name need to be accuarate and working.. )

solution was found rather ironically on a competing blog publishing tool’s website: http://textpattern.com/faq/173/password-protected-directories-with-htaccess