From: Rainer Jung Date: Tue, 12 Feb 2013 12:27:06 +0000 (+0000) Subject: FallbackResource: Support for the 'disabled' argument X-Git-Tag: 2.2.24~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=132440f33baf689bd18b4e48c9c0761d4f16a56d;p=thirdparty%2Fapache%2Fhttpd.git FallbackResource: Support for the 'disabled' argument Backport of r1398066 from trunk resp. r1416585 form 2.4.x. Submitted by: gryzor Reviewed by: wrowe, rjung Backported by: gryzor git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1445133 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 67d1cfbe939..a4607cbf1b5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.24 + *) mod_dir: Add support for the value 'disabled' in FallbackResource. + [Vincent Deffontaines] + *) mod_ldap: Fix regression in handling "server unavailable" errors on Windows. PR 54140. [Eric Covener] diff --git a/STATUS b/STATUS index bbff2ab8a76..1e75e825181 100644 --- a/STATUS +++ b/STATUS @@ -94,13 +94,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 - Also suggested for backport to 2.4 - 2.2.x src patch: trunk patch works - 2.2.x documentation patch : http://apache-doc-fr.gryzor.com/fallbackresource_disabled_2.2_doc.patch - +1: gryzor, wrowe, rjung - 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 c019d7b11f7..a42b9f4d83c 100644 --- a/docs/manual/mod/mod_dir.xml +++ b/docs/manual/mod/mod_dir.xml @@ -43,7 +43,7 @@

The two functions are separated so that you can completely remove (or replace) automatic index generation should you want - to.

+ to.

A "trailing slash" redirect is issued when the server receives a request for a URL @@ -95,8 +95,8 @@ a directory executed if neither index.html or index.txt existed in a directory.

-

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:

@@ -173,12 +173,13 @@ a directory 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 -Apache HTTP Server 2.2.16 and later +Apache HTTP Server 2.2.16 and later - The disabled argument +is supported since 2.2.24

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). @@ -202,6 +203,8 @@ 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:

@@ -211,6 +214,11 @@ a directory 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 860b9dcec85..ad83fa5f21e 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -106,7 +106,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 DefaultHandler points to something that doesn't exist,