0

Under mod_alias, how does Apache order Alias and ScriptAlias directives with respect to each other?

The mod_alias docs say

The ScriptAlias directive has the same behavior as the Alias directive, except that in addition it marks the target directory as containing CGI scripts...

but it's not clear to me that this is meant to imply that ScriptAlias directives are mixed into the same "pool" as Alias directives when Apache determines evaluation order.

For a specific example, I ask because I've encountered the configuration

Alias       /pub         "/var/www/service/files"
ScriptAlias /pub         "/var/www/service/bin/view"

and if the ScriptAlias is evaluated just as if it were any other Alias, then no request will never match the second line.

Are ScriptAlias directives evaluated before, after, or at the same time as Alias directives?

JonahHuron
  • 101
  • 1
  • 2
  • You would probably have to read the source code to be sure. This particular scenario is so senseless that the configuration should probably just quietly be fixed and move on. – Michael Hampton Jul 14 '20 at 19:23
  • @MichaelHampton What would you say is senseless about it? – JonahHuron Jul 15 '20 at 13:59
  • For a URL beginning with `/pub` there is no way for a computer to tell whether the `Alias` or the `ScriptAlias` should be used. The behavior is undefined, and also unpredictable. – Michael Hampton Jul 15 '20 at 14:01

0 Answers0