Created attachment 21754 [details] Enforce Redirect argument types / Consistent args / Better error messages. #1 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. #2 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. #3 Added brackets to the if-blocks according to the Apache C style. #4 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.
I've committed the arguments checking part of your patch to trunk r778942 . Don't agree with the error message changes: yours are out-of-line with other startup errors, and will tend to confuse ("why is this message different?").
Backported to 2.2 in r792917