I just wanted to share this because I spent 3 hours trying to find a solution for my issue. I only found one WordPress thread here in the forums on this, and the solution there did not work for me. Google threw up a few answers - but none of them worked either.
Basically, I have WordPress installed in the root of a site. There's a single directory - outside of WordPress - that needed to be password-protected using .htaccess and .htpasswd. however, there's was a conflict: because of the "Pretty Permalinks" setup, the WordPress was redirecting all attempts to log into the protected area to the default WordPress 404 page.
I tried all kinds of solutions to this - but the one that worked for me (for some weird, crazy unknown reason - I have no idea *why* this works): I saved a copy of the WordPress .htaccess file, then deleted it from my server. I logged into my hosting control panel and password protected the directory. Then I re-uploaded the .htaccess file.
It worked. So bizarre - but there you go. Hopefully it helps someone else.