I have the following Apache config:
Alias /HelpdeskSignIn/ /opt/HelpdeskSignIn/web/
<Location /HelpdeskSignIn/>
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) app.php [E=RU:%1,QSA,L]
RequestHeader set REMOTE_USER %{RU}e
RedirectMatch permanent ^/app\.php/(.*) /$1
</Location>
<Location /HelpdeskSignIn/cccs>
AuthType CAS
Require valid-user
</Location>
The root of the app does not need authentication, but if someone goes to a sub directory of that it needs to be authenticated. If I require a valid CAS user on the whole thing and check the value with PHP it works, but when I try the code above the REMOTE_USER is always empty when hitting PHP code within /cccs. I've tried a few ways of passing that environment variable on the rewrite, but it doesn't seem to work. Is this possible or is there a better way of doing it?