Bug 47754 - MultiViewsMatch does not apply in a <Location> section
Summary: MultiViewsMatch does not apply in a <Location> section
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_negotiation (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2009-08-27 19:02 UTC by Andrew Pimlott
Modified: 2010-11-04 14:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pimlott 2009-08-27 19:02:45 UTC
I have a configuration directive

<Location />
    AddHandler cgi-script cgi
    Options +ExecCGI +MultiViews
    MultiViewsMatch Handlers
</Location>

so that I can access cgi scripts without extensions, eg http://localhost/foo runs foo.cgi in the document root.  The first two directives take effect, as http://localhost/foo.cgi works as expected.  But when I access just /foo, I get the "None could be negotiated" error.  It seems that the MultiViewsMatch Handlers directive is not applied.  If I instead change Location to a Directory, it works:

<Directory /home>
    AddHandler cgi-script cgi
    Options +ExecCGI +MultiViews
    MultiViewsMatch Handlers
</Directory>

Now, http://localhost/foo works.  So it looks as though MultiViewsMatch has no effect in a Location section.

Andrew
Comment 1 William A. Rowe Jr. 2009-08-27 19:23:23 UTC
Behavior is by design.  <Location > refers to a user request, and does
not apply to a filesystem.

Don't abuse <Location > when you mean <Files > or <Directory >
Comment 2 Andrew Pimlott 2009-08-27 21:15:26 UTC
Thanks for the quick reply!  The documentation says that MultiViewsMatch is allowed in directory context and doesn't mention the limitation.  May I suggest adding,

    MultiViewsMatch is not allowed in a <Location> or <LocationMatch> section.

It would be even better if the configuration parser reported this problem instead of silently ignoring the directive.  That would have saved me some confusion.
Comment 3 William A. Rowe Jr. 2009-08-27 21:24:44 UTC
Reopening as a docs bug; fair suggestion, thanks.
Comment 4 Dan Poirier 2009-09-14 09:33:42 UTC
Did both - configuration fails if MultiviewsMatch is in a
Location or LocationMatch section, and added a note to the
doc.

Committed to trunk as r814728.
Comment 5 Andrew Pimlott 2009-09-15 09:06:30 UTC
Great, thanks!
Comment 6 Mina Galić 2010-11-04 14:06:05 UTC
Added more explanation: r1031111
Apparently Options +MultiViews is ignored in any context other than <Directory > too.