Я не могу найти информацию об этом в официальная документация.
Я пытаюсь разрешить доступ к двум файлам php, A.php
и B.php
.
<Files "A.php">
Require all granted
</Files>
<Files "B.php">
Require all granted
</Files>
Так работает или есть решение получше?
Да, это так работает. Но вы также можете использовать FilesMatch
с регулярным выражением вроде:
<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>