httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <>
Subject Re: [users@httpd] How to customize error responses (while using mod_rewrite)?
Date Mon, 15 May 2017 14:53:34 GMT
On Mon, May 15, 2017 at 10:46 AM, Jens Schleusener
<> wrote:
> Unfortunately for the RewriteRule directive for e.g. a Rewrite flag R=4xx
> instead of R=permanent isn't allowed (only 300-399, why?) so I had
> considered the usage of the <If> directive but didn't find a working
> solution.

Other codes are allowed, but you can't do anything with the
substitution in this case. The reason is that if you return any status
code like this, it short-circuits the processing of the URL by the
rest of the server, so nobody is around to convert the URL to a file
and serve it.

The manual says:
Any valid HTTP response status code may be specified, using the syntax
[R=305], with a 302 status code being used by default if none is
specified. The status code specified need not necessarily be a
redirect (3xx) status code. However, if a status code is outside the
redirect range (300-399) then the substitution string is dropped
entirely, and rewriting is stopped as if the L were used.

Eric Covener

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

View raw message