You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dennis Jacobfeuerborn <de...@conversis.de> on 2010/12/06 02:56:54 UTC

[users@httpd] Filters not applied with ErrorDocument pages?

I just noticed that when I use ErrorDocument to server custom 404 pages the 
output filter I defined is not getting used anymore. Is there some special 
configuration required to make the filters also work on custom error pages?

Regards,
   Dennis

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Filters not applied with ErrorDocument pages?

Posted by Dennis Jacobfeuerborn <de...@conversis.de>.
On 12/07/2010 08:25 PM, Joost de Heer wrote:
> On Mon, December 6, 2010 02:56, Dennis Jacobfeuerborn wrote:
>> I just noticed that when I use ErrorDocument to server custom 404 pages
>> the
>> output filter I defined is not getting used anymore. Is there some special
>> configuration required to make the filters also work on custom error
>> pages?
>
> How do you define the error pages? I haven't tried it, but I'd guess that
> ErrorDcument 404 http://your.server/404.html will result in a new request,
> and that filters will be applied in this case.

That doesn't work because if you redirect the forces Apache to use a 30x 
status which means the 404 cannot be returned anymore. What I'm doing is 
basically:

ErrorDocument 404 /_errors/404.html

That way I can serve the error_pages with a proper 404 status.

Regards,
   Dennis

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Filters not applied with ErrorDocument pages?

Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
On Mon, December 6, 2010 02:56, Dennis Jacobfeuerborn wrote:
> I just noticed that when I use ErrorDocument to server custom 404 pages
> the
> output filter I defined is not getting used anymore. Is there some special
> configuration required to make the filters also work on custom error
> pages?

How do you define the error pages? I haven't tried it, but I'd guess that
ErrorDcument 404 http://your.server/404.html will result in a new request,
and that filters will be applied in this case.

Joost

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Filters not applied with ErrorDocument pages?

Posted by Igor Galić <i....@brainsware.org>.
> Maybe there is a way to get ErrorDocuments filtered too but it's not 
> documented? Any help would be appreciated.

I can fix that at least ;)

But yeah, I'm still waiting for an official answer (haven't had time
to look into the code myself yet) from a developer.
 
> Regards,
>    Dennis

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Filters not applied with ErrorDocument pages?

Posted by Dennis Jacobfeuerborn <de...@conversis.de>.
On 12/06/2010 08:40 PM, Igor Galić wrote:
>
> ----- "Dennis Jacobfeuerborn"<de...@conversis.de>  wrote:
>
>> I just noticed that when I use ErrorDocument to server custom 404
>> pages the
>> output filter I defined is not getting used anymore. Is there some
>> special
>> configuration required to make the filters also work on custom error
>> pages?
>
> I've noticed that myself. But I think it's actually quite good it doesn't.
> Most HTTP clients have a hard time dealing with HTTP as is.
> Confusing them with Transfer-Encoding and similar things, while confusing
> them with Errors -- that just might be too much.

If the filter mangles the output so that the client is unable to deal with 
the response that's arguably a problem with the filter. A custom 404 page 
is just that a standard html page with a 404 status code and I would expect 
that since I configured my filter for the vhost that all delivered pages 
are run through that filter. The fact that this isn't true for 
ErrorDocument should at least be documented. Perhaps a flag would be nice 
to be able to turn that behavior on and off on demand.

> Now, this is my experience (and speculation) using mod_filter+mod_deflate.
> What's your use-case? What's your config? And why do you think you need
> filters applied on Errors as well?

Because the error pages are supposed to look like all other pages. The 
filter trivially adds a header and footer to every page and the error pages 
are supposed to show these as well. One possibility would be to hard-code 
both directly into the error documents but that's just a hack and I would 
have to resort to a copy&paste every time the header needs to be changed.
A more flexible approach would have been to filter all pages and add the 
ability to not only match the filters according to headers but also to 
status codes. That way you could run ErrorDocuments through filters or you 
could just apply them to pages with a 200 status code.

> Finally, if someone of the Devs is spying, can you explain the reason
> behind this reasoning?

Maybe there is a way to get ErrorDocuments filtered too but it's not 
documented? Any help would be appreciated.

Regards,
   Dennis

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Filters not applied with ErrorDocument pages?

Posted by Igor Galić <i....@brainsware.org>.
----- "Dennis Jacobfeuerborn" <de...@conversis.de> wrote:

> I just noticed that when I use ErrorDocument to server custom 404
> pages the 
> output filter I defined is not getting used anymore. Is there some
> special 
> configuration required to make the filters also work on custom error
> pages?

I've noticed that myself. But I think it's actually quite good it doesn't.
Most HTTP clients have a hard time dealing with HTTP as is.
Confusing them with Transfer-Encoding and similar things, while confusing
them with Errors -- that just might be too much.

Now, this is my experience (and speculation) using mod_filter+mod_deflate.
What's your use-case? What's your config? And why do you think you need
filters applied on Errors as well?

Finally, if someone of the Devs is spying, can you explain the reason
behind this reasoning?

> Regards,
>    Dennis

i

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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