Mailing List Archive

Alias/Redirect incompatibility
Apache 0.8.7 (and 0.8.8) processes Aliases before Redirects, whereas
apache 0.6 and NCSA 1.3 process Redirects before Aliases.

Not only is this bahaviour incompatible, I would argue that the 0.8 is
wrong and 0.6 is right. Otherwise it is impossible to redirect documents
which would otherwise be processed by an Alias directive; one would
only be able to redirect documents that would map on to the main
document_root tree.

A patch follows.

This should be mentioned in the 0.8.8 release notes.

David.


-------------------- Begin file alias.patch ---------------------------------
*** mod_alias.c~ Tue Aug 1 01:46:04 1995
--- mod_alias.c Mon Aug 7 17:13:07 1995
***************
*** 167,180 ****
if (r->uri[0] != '/' && r->uri[0] != '\0')
return BAD_REQUEST;

- if ((ret = try_alias_list (r, conf->aliases)) != NULL) {
- r->filename = ret;
- return OK;
- }
-
if ((ret = try_alias_list (r, conf->redirects)) != NULL) {
table_set (r->headers_out, "Location", ret);
return REDIRECT;
}

return DECLINED;
--- 167,180 ----
if (r->uri[0] != '/' && r->uri[0] != '\0')
return BAD_REQUEST;

if ((ret = try_alias_list (r, conf->redirects)) != NULL) {
table_set (r->headers_out, "Location", ret);
return REDIRECT;
+ }
+
+ if ((ret = try_alias_list (r, conf->aliases)) != NULL) {
+ r->filename = ret;
+ return OK;
}

return DECLINED;
-------------------- End file alias.patch ---------------------------------