79660576

Date: 2025-06-10 13:55:54
Score: 0.5
Natty:
Report link

After quite some testing I finally figured out that I can use an <If> directive and the REQUEST_FILENAME variable to achieve an explicit whitelist based on absolute file paths, i.e.

<Directory "/var/www/html/*">
   Require all denied
   <FilesMatch "\.(html?|php|xml)">
      <If "%{REQUEST_FILENAME} =~ m#/var/www/html/(index\.html|data\.php|content\.xml)#">
         Require all granted
      </If>
   <FilesMatch>
</Directory>
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: cpaitor