.htaccess & WordPress: Exclude folder from RewriteRule

This is the #1 google result and the wrong answer.

The correct answer is adding this before the Wordpress directives.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/subdirectoryname1/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/subdirectoryname2/(.*)$ [OR]
    RewriteRule ^.*$ - [L]
</IfModule>

RewriteCond %{REQUEST_URI} !^/(csNewsAd|csNewsAd/.*)$ 

instead of

RewriteRule ^/csNewsAd($|/) - [L] 

Place the line below in the .htaccess file in the root.

ErrorDocument 401 default

Had the exact same problem and this worked for me. It is not the problem that the redirects don't work. The problem is that the 401 (Authorization Required) error is nog defined so the "popup" doesn't show.