Conditional behavior by status code
Conditional behavior by status code
am 04.11.2009 15:39:02 von Brian Mearns
Is there any way to get Apache to behave differently based on the
status code, specifically apply different OutputFilters? This is
similar in concept, I believe, to AddOutputFilterByType, which relies
on the generated Content-Type header to determine what filter to
apply. But I want to apply different filters based on the status code.
If there is any way to set an environment variable based on the status
code, that would work as well.
Thanks,
-Brian
--
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Conditional behavior by status code
am 04.11.2009 21:56:20 von Sean Conner
It was thus said that the Great Brian Mearns once stated:
> Is there any way to get Apache to behave differently based on the
> status code, specifically apply different OutputFilters? This is
> similar in concept, I believe, to AddOutputFilterByType, which relies
> on the generated Content-Type header to determine what filter to
> apply. But I want to apply different filters based on the status code.
> If there is any way to set an environment variable based on the status
> code, that would work as well.
If you want to serve a different page depending upon the status, there is
the ErrorDocument directive.
-spc
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Conditional behavior by status code
am 04.11.2009 22:23:42 von Nick Kew
>> Is there any way to get Apache to behave differently based on the
>> status code, specifically apply different OutputFilters? This is
With httpd-2.3/2.4, just make that a condition for FilterProvider.
With 2.2, condition evaluation is more limited so you can't do that.
It would be a fairly trivial hack to mod_filter, or you could make
the check within your filter itself.
> If you want to serve a different page depending upon the status, there is
> the ErrorDocument directive.
That's fine if it is an errordocument coming from the server itself,
but not useful if it's from some application.
--
Nick Kew
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Conditional behavior by status code
am 05.11.2009 15:22:05 von Brian Mearns
On Wed, Nov 4, 2009 at 4:23 PM, Nick Kew wrote:
>
>>> Is there any way to get Apache to behave differently based on the
>>> status code, specifically apply different OutputFilters? This is
>
> With httpd-2.3/2.4, just make that a condition for FilterProvider.
>
> With 2.2, condition evaluation is more limited so you can't do that.
> It would be a fairly trivial hack to mod_filter, or you could make
> the check within your filter itself.
Okay, I am currently using 2.2, but maybe I'll think about upgrading.
If my filter wasn't an external, I would probably just check in there,
as you said. But it is an external filter...I don't think I have
access to the status code at all, right?
>> =A0If you want to serve a different page depending upon the status, ther=
e is
>> the ErrorDocument directive.
>
> That's fine if it is an errordocument coming from the server itself,
> but not useful if it's from some application.
[clip]
Right, this has nothing to do with error responses. As I mentioned in
the original post, I want to control filter behavior based on the
response code. Specifically, I just want to skip a bunch of processing
filters for 304 Not Modified responses.
-Brian
--=20
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://keys.gnupg.net
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org