0
votes

I've upgraded from Apache 2.2 to 2.4 and all but one type of my URL rewrite rules are working as expected. It appears that the following rule isn't working. I removed the IP address for security purposes.

RequestHeader unset Authorization RewriteEngine On RewriteRule /xmldb/VATIncidentPoint/(.*)$ http://x.x.x.x:8080/exist/rest/db/VATIncidentPoint/${user2group:%{LA-U:REMOTE_USER}}/$1 [P]

It appears what's happening is that the section including user2group is not getting replaced with the group that the user is a part of. This results in 2 slashes at the end of the url instead of getting replaced with the group '//'. Is there a different way to do this in 2.4 than there was in 2.2?

Thanks in advance!

1
UPDATE - After enable logging for mod_rewrite I was able to see that the REMOTE_USER variable isn't being set. That is why the lookup in the user2group map is failing. Any ideas why this variable isn't working for Apache 2.4. I know it works on 2.2 and I read about using it here: httpd.apache.org/docs/current/mod/mod_rewrite.htmlJason King

1 Answers

0
votes

The issue was that in the Location block there was 2 require statements.

Require all granted AND Require valid-user

This was causing the REMOTE_USER value to never be looked up and therefore causing nothing to be returned from the map. Removing 'Require all granted' and leaving 'Require valid-user' solved the issue.