I have the following rewrite rule: RewriteCond %{REQUEST_URI} /test RewriteCond %{QUERY_STRING} .*a=([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).* [NC] RewriteRule .* - [E=X-Tenant-Id:%1,L] This matches the query string to the supplied pattern in a case insensitive way. However, the back reference %1 is always lower case, independent of the actual query string. That is, if the query string is: http://localhost:8080/test?a=CFA2AFDF-5D36-4D1F-B798-430557CF4355 the matched back reference %1 is cfa2afdf-5d36-4d1f-b798-430557cf4355. This is strange and unexpected. It is also not how NC works in The Apache HTTP server mod_rewrite, which just does the test in a case insensitive way but returns the actual matched group. Case insensitive Java regular expressions also do not change the case of any of the matched groups.
This has been fixed in the following branches: - 9.0.x for 9.0.0.M11 onwards - 8.5.x for 8.5.6 onwards - 8.0.x for 8.0.38 onwards