httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] Custom Error Handling
Date Mon, 15 Jun 2009 11:31:12 GMT
Alan Wilson wrote:
> Hi,
>  
> I'm trying to get httpd to return a custom error code via a CGI, eg if the
> client makes a connection to test.cgi (which is a valid URI) but the
> parameters, POST data or some other aspect of the interaction is incorrect I
> want to return a different error code from the standard 200, eg  "Status:
> 303 You've not included valid data"
>  
> Is this possible and if so, what part of Apache do I need to change ?
>  
> Hope the request makes sense !
>  
Yes and no.
Yes, in the sense that you can do this.
No, in the sense that it is not at the Apache level that you must do it, 
but at the level of your cgi-bin program.
It is that one that should return a HTTP status different from 'OK'.
And if you return a code other than 200, you should check which is the 
proper code to return according to the HTTP protocol, not just invent one.
See here : http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html


---------------------------------------------------------------------
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


Mime
View raw message