RequestHeader set X-AUTH-DECODE "expr=%{HTTP:Authorization}" RequestHeader edit X-AUTH-DECODE "^Basic (.*)$" $1 RequestHeader set USER "expr=%{unbase64:%{HTTP:X-AUTH-DECODE}}" RequestHeader set PASSWORD "expr=%{unbase64:%{HTTP:X-AUTH-DECODE}}" RequestHeader edit USER "(.*):.*$" $1 RequestHeader edit PASSWORD ".*:(.*)$" $1 RewriteRule .* - [E=HTTP_USER:%{HTTP:User}] RewriteRule .* - [E=HTTP_PASSWORD:%{HTTP:Password}] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]