I’ve really had to look to find a solution for this but I found it.
at the top of the .htaccess for the parent directory to the one you want to exclude, in your case probably the wordpress root add the following line
RewriteRule ^foo/ – [L]
change foo to the name of the directory you want to exclude from WordPress’s htaccess directives