Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Regex Htaccess:拒绝访问同名的所有文件_Regex_.htaccess - Fatal编程技术网

Regex Htaccess:拒绝访问同名的所有文件

Regex Htaccess:拒绝访问同名的所有文件,regex,.htaccess,Regex,.htaccess,我想这样做 <Files "config.xml"> order allow,deny deny from all </Files> 命令允许,拒绝 全盘否定 在与config.xml名称匹配的所有子目录中的所有文件上 如何做到这一点?我想我必须使用正则表达式 谢谢这会将任何请求中的confix.xml重定向到403禁止页面: RewriteEngine On RewriteCond %{REQUEST_URI} .*/config\.xml [N

我想这样做

<Files "config.xml">
    order allow,deny
    deny from all
</Files>

命令允许,拒绝
全盘否定
在与config.xml名称匹配的所有子目录中的所有文件上

如何做到这一点?我想我必须使用正则表达式


谢谢这会将任何请求中的confix.xml重定向到403禁止页面:

RewriteEngine On
RewriteCond  %{REQUEST_URI} .*/config\.xml [NC]
RewriteRule .* / [F,L]