对目录中所有文件类型的httpd块访问,但允许访问单个文件。

问题描述 投票:0回答:1

在我的网站里面我有一个目录/ here / is / / dir / path

我想允许访问子目录中的单个文件示例:test / testfile.xml但是要拒绝访问其他文件列表(jsp,class,jar,xml)

我有这个我想放在httpd.conf中

    <Directory /here/is/the/dir/path >

    <FilesMatch "test.xml">
    Order Allow,Deny 
    Allow from All 
    Deny from None 
    </FilesMatch>

    <FilesMatch "+\.(jsp|class|jar|xml)">
    order allow,deny
    deny from all
    </FilesMatch>

    </Directory>

这是写这个的正确方法吗?有没有办法将我的两个文件匹配语句组合成一个语句?

apache httpd.conf
1个回答
0
投票

所述方法已经过测试并且正在运行。

© www.soinside.com 2019 - 2024. All rights reserved.