Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

How to set the http response code for an error message

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


evgeny at inovvia

Apr 9, 2012, 5:12 AM

Post #1 of 4 (299 views)
Permalink
How to set the http response code for an error message

Hi,

I have a custom error message that I set into the request by "ap_rputs" function.
Still....the page returns http 200. How do I set it to a specific error code?

Thanks,
Evgeny


covener at gmail

Apr 9, 2012, 6:12 AM

Post #2 of 4 (292 views)
Permalink
Re: How to set the http response code for an error message [In reply to]

On Mon, Apr 9, 2012 at 8:12 AM, Evgeny Shvidky <evgeny [at] inovvia> wrote:
> I have a custom error message that I set into the request by "ap_rputs"
> function.

set r->status to the status code and continue to return OK.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


evgeny at inovvia

Apr 9, 2012, 7:05 AM

Post #3 of 4 (280 views)
Permalink
RE: How to set the http response code for an error message [In reply to]

Hi,

I want to generate a new HTTP error code.
I set in request->status a new opcode and I added in conf file next line " ErrorDocument 449 /449.html"
Error 449 is MS-ActiveSync protocol error.
But... I receive next error from Apache "Unsupported HTTP response code 449".

Thanks,
Evgeny

-----Original Message-----
From: Eric Covener [mailto:covener [at] gmail]
Sent: Monday, April 09, 2012 4:12 PM
To: users [at] httpd
Subject: Re: [users [at] http] How to set the http response code for an error message

On Mon, Apr 9, 2012 at 8:12 AM, Evgeny Shvidky <evgeny [at] inovvia> wrote:
> I have a custom error message that I set into the request by "ap_rputs"
> function.

set r->status to the status code and continue to return OK.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


trawick at gmail

Apr 9, 2012, 8:01 AM

Post #4 of 4 (280 views)
Permalink
Re: How to set the http response code for an error message [In reply to]

On Mon, Apr 9, 2012 at 10:05 AM, Evgeny Shvidky <evgeny [at] inovvia> wrote:
> Hi,
>
> I want to generate a new HTTP error code.
> I set in request->status a new opcode and I added in conf file next line " ErrorDocument 449 /449.html"
> Error 449 is MS-ActiveSync protocol error.
> But... I receive next error from Apache "Unsupported HTTP response code 449".

You have to set r->status_line too if httpd doesn't have a built-in
status string for the code you're setting. The status line should
start with the status code and a space character, followed by the
desired text.

>
> Thanks,
> Evgeny
>
> -----Original Message-----
> From: Eric Covener [mailto:covener [at] gmail]
> Sent: Monday, April 09, 2012 4:12 PM
> To: users [at] httpd
> Subject: Re: [users [at] http] How to set the http response code for an error message
>
> On Mon, Apr 9, 2012 at 8:12 AM, Evgeny Shvidky <evgeny [at] inovvia> wrote:
>> I have a custom error message that I set into the request by "ap_rputs"
>> function.
>
> set r->status to the status code and continue to return OK.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>



--
Born in Roswell... married an alien...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.