Re: HTTP Redirect
[email protected] ("Will Coleda") Mon, 09 Jul 2007 15:47:42 -0400
| Newsgroups | perl.combust.users |
|---|---|
| Message-ID | <[email protected]> |
Ask Bj=C3=B8rn Hansen writes:=20
Ah, .htredirects is perfect, and already exists for parrotcode.org; Thank=
s!=20
>=20
> On Jul 9, 2007, at 10:44, Will Coleda wrote:=20
>=20
>> Hello, all.
>> I'm Trying to figure out how to emit an HTTP redirect instead of =20
>> content.
>> Pointers to docs, examples, or which source files to poke at most =20
>> appreciated: I see lib/Combust/Redirect.pm, which looks like somethin=
g=20
>> I'd want, but I can't see how to invoke it from a template file.
>=20
> There are (at least) two ways - you probably want the second one. If=20
> not, then tell what you are trying to do and we'll figure it out.=20
>=20
> 1) In the controller you can return $self->redirect($new_url) instead =
of=20
> return OK, $self->evaluate_template("template"). You can't do that f=
rom=20
> the templates (it wouldn't be hard to do; we've just never needed it.=20
>=20
>=20
> 2) If Combust::Redirect is enabled, as it is for most of the sites an=
d=20
> can be for the rest, then you can setup redirects in the .htredirects=20
> file - there's an example on the www site:
> =09http://svn.perl.org/perl.org/docs/live/www/.htredirects=20
>=20
> The syntax is
> regexp target_url options=20
>=20
> options can be "perm", "temp" or "intern" (or shortened or longer vers=
ion=20
> of that).=20
>=20
> internal gives an internal redirect (not seen by the user)
> permanent a 301 response
> temporary (the default) a 302 response.=20
>=20
>=20
> - ask=20
>=20
> --=20
> http://log.perl.org/ - http://askask.com/ - http://develooper.com/=20
>=20
>=20