0

Is there a way to configure Apache to redirect the client to a different URL instead of displaying the "requested entity too large" error when the LimitRequestFieldSize value is reached?

1 Answer 1

2

Would creating a custom error page for that condition (which is response code 413 IIRC) be sufficient?

That can be done with ErrorDocument 413 /path/to/error/document.html in your Apache config (either the main configuration file(s), or in .htaccess if that processing is turned on).

See http://httpd.apache.org/docs/2.2/mod/core.html#errordocument for documentation.

4
  • If you really wanted to redirect your users you could use a <meta http-equiv> redirect and a javascript redirect in your custom 413 error document.
    – Ladadadada
    Nov 25, 2011 at 10:14
  • @Ladadadadadadadadada: The ErrorDocument directive allows you to specify a full URL (including one pointing to an external server) so using a "manual" client-side redirect probably isn't neccesary. Nov 25, 2011 at 10:24
  • Would that mean that Apache would retrieve the URL and send the content of it as the 413 response or does it just send a 30x response with the Location header set to that URL? I've never actually tried putting a URL in an ErrorDocument directive.
    – Ladadadada
    Nov 25, 2011 at 10:29
  • I belive it would send a 30x response and have the client request the alternate object seperately, the note in the documentation about 401 (authenticate required) errors supports this assumption though I've never tried it myself to be sure. Nov 25, 2011 at 14:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .