I've got 2 registered domains, a.com and b.com. One hosting account. Right now a.com is the primary one and so I've set up 301 redirect to b.com because the plan is to get rid of domain a.
The redirect works fine generally, but I have an http authed directory under domain a and this does not work. When a.com/authed_dir is asked I expect it redirected to b.com/authed_dir as is done with any other directory successfully and then http auth dialog. This does not happen, instead I'm shown 404 page. As soon as I turn http auth off it redirects as I expect.
Why is that? How can I have both redirection and http auth working?
Redirect is following:
RewriteCond %{HTTP_HOST} ^a.com [NC]
RewriteRule (.*) http://b.com/$1 [L,R=301]