Skip to main content
Tweeted twitter.com/StackWebmasters/status/1196352452179742720
Became Hot Network Question
edited title
Link
posfan12
  • 716
  • 2
  • 7
  • 14

Deny access to all PHP files using FilesMatch, but make an exception for one file

More into title, add tags
Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

Multiple Deny access to all PHP files using FilesMatch in, but make an exception for one htaccess?

Source Link
posfan12
  • 716
  • 2
  • 7
  • 14

Multiple FilesMatch in one htaccess?

Currently, using htaccess I am denying access to any PHP file in a directory, but not the JS, PNG, CSS files in the same directory.

<FilesMatch "\.php$">
Order deny,allow
Deny from all
</FilesMatch>

What if I want to make an exception for one file ("foobar.php" for example) however? Can I write multiple statements in a single htaccess? What is the order of execution?