Wordpress installed in root / with its default .htaccess file
I had another script installed in /otherscript sub-directory with .htaccess/.htpasswd protection.
Trying to access the /otherscript sub-directory creates a Wordpress 404 error, rather than the pop-up login box you'd expect to see.
Simply edit the Wordpress .htaccess and at the very top of the file add:
All thanks for this solution go to Andrew Rollins who blogged about this back in 2008 - I have merely made my own record of it here just in case anything ever happened to Andrew's page. Also if you check his blog posting you'll find some alternatives to the line above, such as specifying a custom 401 page.
ErrorDocument 401 default