Change Underscore to Dash in Apache Header

Solution 1:

The value of a RequestHeader set supports expressions, and expressions include the req (or http) function, which gives you the value of request headers. So this one directive should do what you want:

RequestHeader set X-CAS-email-primary "expr=%{req:X-CAS-email_primary}"

You have to dig deep into the documentation to find this kind of thing, but it's there.

Not sure why your configuration didn't work, but I guess the SetEnvIfNoCase is evaluated after the RequestHeader. The docs don't make it easy to figure that out.