httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44729] New: Redirect accepts anything as first argument instead of only HTTP status codes .
Date Tue, 01 Apr 2008 17:31:36 GMT

           Summary: Redirect accepts anything as first argument instead of
                    only HTTP status codes.
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: mod_alias

Created an attachment (id=21754)
 --> (
Enforce Redirect argument types / Consistent args / Better error messages.


Given three arguments to mod_alias/Redirect, the first one should be a HTTP
status code, followed by the old and the new, target URL. However, Redirect
silently accepts arguments like

Redirect bla / http://anywhere

takes bla as a URL and redirects it to / (and in turn ignores http://anywhere),
instead of complaining that "bla" is not a valid HTTP status code.

While this is a minor violation of the docs, it frequently bugs the user (read:
me) whenever he (me) gets tricked by remembering "Redirect permanent" into
entering "Redirect temporary" instead of the correct "Redirect temp", thus
adding useless Redirects, causing chaos and doom in the Web.

Since the bug on the user-side has been sitting there for years, won't get
fixed soon and might already be considered a feature, I've appended a
workaround patch to mod_alias to enforce the words as they've been written in
the docs.


The patch furthermore extends the argument list with perm (following the
existing temp) and, more important, temporary (following the existing
permanent). Makes usage more straight-forward and consistent.


Added brackets to the if-blocks according to the Apache C style.


While at it, I've prepended "mod_alias/Redirect: " to add_redirect_internal()'s
error messages. You might know that the line "Regular expression could not be
compiled." in error_log comes from a Redirect statement (at least as long as
you just modified one), however "mod_alias/Redirect: Regular expression could
not be compiled." makes it 100% clear where to look.
Error messages should not be riddles, the error itself is enough.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message