Re: Custom Error Handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux