Forum Moderators: phranque

Message Too Old, No Replies

Apache module precedence

module precedence

         

dfresh4130

6:36 pm on Oct 31, 2014 (gmt 0)

10+ Year Member



I've been asked to work on shortening our URLs for SEO optimization. Our site uses Adobe CQ for content and localization purposes and we have that configured using SetHandler for / like below.

 
<Directory />
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
Options FollowSymLinks +Includes
AllowOverride None
</Directory>


We also use a lot of rewrite rules. Is there a way to tell if the dispatcher or rewrite modules takes precedence?

lucy24

8:39 pm on Oct 31, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it your own server? Presumably yes, if you've got <Directory> sections. (But if so, why the <IfModule envelope? Either you've got it or you haven't.) Usually-but-not-always, mods execute in the opposite order of loading. In practice, you can often assume reverse alphabetical order, so mod_rewrite happens very early while mod_authzthingummy is at or near the end. Sometimes it's faster just to experiment: make up a pair of rules that will have different consequences depending on which mod a request meets first, and see what happens.

Options FollowSymLinks +Includes

Don't the Apache docs say something severe and frightening about combining with-and-without + statements in an Options line?
:: detour to check both 2.2 and 2.4 ::
Yup, in 2.2 it's the dreaded "likely to produce unexpected results" while in 2.4 the server simply won't start. (Or did they mean "the whole line will be ignored"? Either way, not desirable.) Can we stipulate that it was a typo?

dfresh4130

10:01 pm on Nov 3, 2014 (gmt 0)

10+ Year Member



Thanks for the info. The configs in question for the mixing of statements with and without +/- symbols is correct. I know it's bad, but this is the config I inherited and I'm not allowed to make changes unless I can prove they're necessary. This config has been in place for a long time before I joined this company.