You wish to password protect a subdirectory with a .htpassword and .htaccess, but you have WordPress installed in the root with perma-links enabled. The solution is simple.
1. Create a new file in the subdirectory (public_html/path/to/) and name it onerror.html
2. Edit the root .htaccess where the modrewrite rules are for wordpress. Add the following line to the very top of the file and save.