tl; dr: How to do the following in a .conf or .htaccess file:
<IfApache22> # Do A </IfApache22> <IfApache24> # Do B </IfApache24>
Longer question:
With Apache 2.4, the old Order becomes obsolete in favor of Require .
In my .htaccess files I have
<FilesMatch "\.(long|list|file|types)$"> Order allow,deny </FilesMatch>
which means that Apache does not start unless I enable access_compat . While this creates a useful solution, I want a solution that works with both syntaxes, as config will propagate to a large number of servers. The question is how can I determine the current version of Apache and apply the correct directive.
I intend to use the file for the framework, which is distributed and used by many people, and I can not control / guarantee that they have or not any specific server settings, so I would like the file to be 2.2 / 2.4 "agnostic" .
apache .htaccess
Letharion May 22 '12 at 17:42 2012-05-22 17:42
source share