0
The following directive appears to fail in that it results in a 403 error. The server supports version 2.4 of Apache.
<If "%{REQUEST_URI} =~ m#^(.*)?/uploads/(.*\.txt)#">
Require all denied
</If>
The objective of the directive is to deny all requests and/or execution of text files in the directory "upload". The htaccess file is in the root of the web directory.
Based on the documentation from Apache the syntax is correct and should work.
The code block including the one in the question exhibits peculiar behavior in that it works intermittently i.e. there is no failure however text files remain accessible. – Motivated – 2019-08-14T19:23:21.823