Webdav将REMOTE_USER全部改写为空

我正在尝试根据经过身份validation的用户重写一个url。 但REMOTE_USER总是空的。 authentication工作。

我在这里很困惑…我错过了什么?

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 

这是重写日志:

 ::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' 

您没有为/webdavconfiguration任何身份validation,因此在这个RewriteRule被触发时,没有REMOTE_USER 。 您需要通过与保护/home/storage相同的身份validationconfiguration来保护/home/storage /webdav

像这样的东西:

 <Directory /home/storage> AuthName "WebDAV" AuthType Basic AuthBasicProvider ldap AuthzLDAPAuthoritative On AuthLDAPURL "ldap://xxxx/ou=Staff,ou=AUM,dc=xx,dc=xx?sAMAccountName?sub" </Directory> <Location /webdav/> AuthName "WebDAV" AuthType Basic AuthBasicProvider ldap AuthzLDAPAuthoritative On AuthLDAPURL "ldap://xxxx/ou=Staff,ou=AUM,dc=xx,dc=xx?sAMAccountName?sub" </Location> RewriteRule ^/webdav/(.*) /var/www/webdav/%{LA-U:REMOTE_USER}/$1