Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache:有没有办法在文件匹配中使用远程用户?_Apache_.htaccess_Authentication - Fatal编程技术网

Apache:有没有办法在文件匹配中使用远程用户?

Apache:有没有办法在文件匹配中使用远程用户?,apache,.htaccess,authentication,Apache,.htaccess,Authentication,用户名:foo@foobar.com 那么,允许用户访问以其姓名开头的任何文件的最佳方式是什么呢?(例如foo_bar.pdf、foo.txt、footree.log) #。。。其他身份验证的东西在这里。。。 重写条件%{REMOTE_USER}^(.*)@ 需要有效用户 # ... other authentication stuff here ... RewriteCond %{REMOTE_USER} ^(.*?)@ <FilesMatch "%1.*?\..*">

用户名:
foo@foobar.com

那么,允许用户访问以其姓名开头的任何文件的最佳方式是什么呢?(例如foo_bar.pdf、foo.txt、footree.log)

#。。。其他身份验证的东西在这里。。。
重写条件%{REMOTE_USER}^(.*)@
需要有效用户
# ... other authentication stuff here ...

RewriteCond %{REMOTE_USER} ^(.*?)@
<FilesMatch "%1.*?\..*">
   require valid-user
</FilesMatch>