I am trying to rewrite an url according to the authenticated user. But REMOTE_USER is always empty. Authentication works.
I am quite puzzled here... am I missing something?
RewriteEngine On
RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 3
<Directory /home/storage>
Order Allow,Deny
Allow from all
Dav On
Options Indexes
AllowOverride None
AuthName "Webdav: insert your username and password"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPBindDN cn=adsyncldapagent,ou=Service,ou=AdminUsers,ou=ITS,dc=xx,dc=xx
AuthLDAPBindPassword xxxx
AuthzLDAPAuthoritative On
AuthLDAPURL "ldap://xxxx/ou=Staff,ou=AUM,dc=xx,dc=xx?sAMAccountName?sub"
<LimitExcept GET POST>
Require valid-user
</LimitExcept>
</Directory>
RewriteCond %{REQUEST_URI} ^/webdav
RewriteRule . /home/storage/%{LA-U:REMOTE_USER}p
This is the rewrite log:
::1 - - [07/Mar/2013:20:26:17 +0100] [localhost/sid#7faeae695fe8][rid#7faeae766368/subreq] (2) init rewrite engine with requested uri /webdav
::1 - - [07/Mar/2013:20:26:17 +0100] [localhost/sid#7faeae695fe8][rid#7faeae766368/subreq] (3) applying pattern '.' to uri '/webdav'
::1 - - [07/Mar/2013:20:26:17 +0100] [localhost/sid#7faeae695fe8][rid#7faeae766368/subreq] (2) rewrite '/webdav' -> '/home/storage/p'