From: Jim Jagielski
Date: Mon, 3 Dec 2012 16:43:47 +0000 (+0000)
Subject: Merge r1398066 from trunk:
X-Git-Tag: 2.4.4~383
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d88cc0429b626f50e87a7050d9e79307639684dd;p=apache
Merge r1398066 from trunk:
FallbackResource : Support for the 'disabled' argument
Submitted by: gryzor
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1416585 13f79535-47bb-0310-9956-ffa450edef68
---
diff --git a/STATUS b/STATUS
index 107dc0d32b..c4eceb81cc 100644
--- a/STATUS
+++ b/STATUS
@@ -91,11 +91,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_dir: Support for the 'disabled' FallbackResource argument
- trunk patch : https://svn.apache.org/viewvc?view=revision&revision=1398066
- 2.4.x src patch: trunk patch works
- documentation patch : http://apache-doc-fr.gryzor.com/fallbackresource_disabled_2.4_doc.patch
- +1: gryzor, covener, sf
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
diff --git a/docs/manual/mod/mod_dir.xml b/docs/manual/mod/mod_dir.xml
index caf5197e33..29c87e5c50 100644
--- a/docs/manual/mod/mod_dir.xml
+++ b/docs/manual/mod/mod_dir.xml
@@ -102,8 +102,8 @@ a directory
literally if it has any arguments before or after it, even if they are "disabled"
as well.
- Note: Multiple DirectoryIndex
- directives within the same context will add
+
Note: Multiple DirectoryIndex
+ directives within the same context will add
to the list of resources to look for rather than replace:
@@ -215,18 +215,20 @@ a directory
index.html
file. But a request without trailing slash
would list the directory contents.
- Also note that some browsers may erroneously change POST requests into GET
+
Also note that some browsers may erroneously change POST requests into GET
(thus discarding POST data) when a redirect is issued.
FallbackResource
Define a default URL for requests that don't map to a file
-FallbackResource local-url
+FallbackResource disabled | local-url
None - httpd will return 404 (Not Found)
server configvirtual host
directory.htaccess
Indexes
+The disabled
argument is available in version 2.4.4 and
+later
Use this to set a handler for any URL that doesn't map to anything
in your filesystem, and would otherwise return HTTP 404 (Not Found).
@@ -250,11 +252,16 @@ a directory
Existing files, such as images, css files, and so on, will be
served normally.
+ Use the disabled
argument to disable that feature
+ if inheritance from a parent directory is not desired.
In a sub-URI, such as http://example.com/blog/ this
sub-URI has to be supplied as local-url:
<Directory /web/example.com/htdocs/blog>
FallbackResource /blog/index.php
+</Directory>
+<Directory /web/example.com/htdocs/blog/images>
+ FallbackResource disabled
</Directory>
diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c
index 52d0273e5d..4364ff9551 100644
--- a/modules/mappers/mod_dir.c
+++ b/modules/mappers/mod_dir.c
@@ -162,7 +162,7 @@ static int fixup_dflt(request_rec *r)
int error_notfound = 0;
name_ptr = d->dflt;
- if (name_ptr == NULL) {
+ if ((name_ptr == NULL) || !(strcasecmp(name_ptr,"disabled"))){
return DECLINED;
}
/* XXX: if FallbackResource points to something that doesn't exist,