views:

37

answers:

1

I'm using mod_rewrite to redirect people from one domain to another (whilst preserving the rest of the URL). Both domains point at the same codebase.

One of the directories has authentication controlled by a local .htaccess file.

These authentication directives get processed before the mod_rewrite rule are processed. Therefore the client gets asked for a password twice.

I've tried putting mod_rewrite rules into the .htaccess file, above the authentication related directives, but it fails in a strange way.

What's the easiest way to prevent this double authentication?

A: 

Put your authentication directives into the <VirtualHost> block of the host you want the users to be authenticated.

Gumbo