Steps to Reproduce: 1. Put an Alias (or ScriptAlias) inside a <Directory ...> or <If ...> tag pair in the configuration. https://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias says it is OK in directory context. 2. Run apache2ctl configtest Actual Results: Alias cannot occur within directory context Expected Results: Syntax OK Build: 2.4.43 built 2020-05-10T19:30:48
For the records, the French doc is not in line with it.
Thank you for the information. Directory context appears to have been added by revision 1731088 but the commit message does not clarify it for me. https://svn.apache.org/viewvc?view=revision&revision=1731088
The doc should be tweaked. The "directory" mentioned is related to a set of directives. See [1]. This set is: <Directory>, <Location>, <Files>, <If>, and <Proxy> However, this directive is explicitly disallowed in <Directory>, <File> and <If> in the code. So it should work only in <Location> and <Proxy> + (server config and virtual host) [1]: https://httpd.apache.org/docs/2.4/mod/directive-dict.html#Context
(In reply to mjr from comment #2) > Thank you for the information. > > Directory context appears to have been added by revision 1731088 but the > commit message does not clarify it for me. > > https://svn.apache.org/viewvc?view=revision&revision=1731088 xfomrs in the commit in related to xml --> html transformation when building the doc. The commit related to the real change is r1731081 on 2.4.x and r1653941 on trunk.
Thank you again. If I may beg further indulgence: why is Alias forbidden in <If ...>...</If>? It really would ease macro-writing if some Alias statements could be conditional on a parameter.