You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by nik600 <ni...@gmail.com> on 2014/11/23 00:22:10 UTC

[users@httpd] set up a 302 Location in ap_hook_translate_name

Dear all

i'm using a ap_hook_translate_name custom module to process some custom
logic and decide the final name of the request.

in some situation i'm putting a Location: http://foo.com/mypage header with

apr_table_add(r->headers_out, "Location", "http://foo.com/mypage");

but the HTTP_STATUS returned is  200, so the client doesn't handle correcty
the request.

So, i've got 3 question:

- is possible to set-up in this hook a REDIRECT_STATUS 302
- if yes, how ?
- if no, what is the hook to use and how can i set the http status?

Thanks to all in advance

-- 
/*************/
nik600
http://www.kumbe.it

Re: [users@httpd] set up a 302 Location in ap_hook_translate_name

Posted by nik600 <ni...@gmail.com>.
ok, it's enoug to return directly the http_status instead of OK or DECLINED.

Example:

apr_table_add(r->headers_out, "Location", "http://www.google.it");
return 302;

Thanks!
Bye

2014-11-23 0:27 GMT+01:00 Eric Covener <co...@gmail.com>:

> On Sat, Nov 22, 2014 at 6:22 PM, nik600 <ni...@gmail.com> wrote:
> > So, i've got 3 question:
> >
> > - is possible to set-up in this hook a REDIRECT_STATUS 302
> > - if yes, how ?
> > - if no, what is the hook to use and how can i set the http status?
>
> Check out how mod_rewrite passes itself a hint between tranlsate_name
> and handler.  Or how mod_alias redirects from the fixup hook.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
/*************/
nik600
http://www.kumbe.it

Re: [users@httpd] set up a 302 Location in ap_hook_translate_name

Posted by Eric Covener <co...@gmail.com>.
On Sat, Nov 22, 2014 at 6:22 PM, nik600 <ni...@gmail.com> wrote:
> So, i've got 3 question:
>
> - is possible to set-up in this hook a REDIRECT_STATUS 302
> - if yes, how ?
> - if no, what is the hook to use and how can i set the http status?

Check out how mod_rewrite passes itself a hint between tranlsate_name
and handler.  Or how mod_alias redirects from the fixup hook.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org