问题原文
原帖链接 · Black · CC BY-SA 4.0
I can't find any info about it in the official documentation.
I try to allow access to two php files, A.php and B.php.
<Files "A.php">
Require all granted
</Files>
<Files "B.php">
Require all granted
</Files>
Does it work like this or is there a better solution?
已采纳解答
原帖链接 · Freddy · CC BY-SA 4.0
Yes, it works like this. But you could also use a FilesMatch with a regular expression like:
<Directory /var/www/html/foobar>
# deny access
Require all denied
# but allow for A.php, B.php
<FilesMatch ^(A|B)\.php$>
Require all granted
</FilesMatch>
# or alternative
#<FilesMatch ^[AB]\.php$>
# Require all granted
#</FilesMatch>
</Directory>
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
