🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: perl.combust.users
Article #1

Re: HTTP Redirect

#1
From: Will Coleda
Date: Mon, 09 Jul 2007 19:47
50 lines
3052 bytes
Ask Bjørn Hansen writes: 

Ah, .htredirects is perfect, and already exists for parrotcode.org; Thanks! 

> 
> On Jul 9, 2007, at 10:44, Will Coleda wrote: 
> 
>> Hello, all.
>> I'm Trying to figure out how to emit an HTTP redirect instead of  
>> content.
>> Pointers to docs, examples, or which source files to poke at most  
>> appreciated: I see lib/Combust/Redirect.pm, which looks like  something 
>> I'd want, but I can't see how to invoke it from a  template file.
> 
> There are (at least) two ways - you probably want the second one.    If 
> not, then tell what you are trying to do and we'll figure it out. 
> 
> 1)  In the controller you can return $self->redirect($new_url)  instead of 
> return OK, $self->evaluate_template("template").   You  can't do that from 
> the templates (it wouldn't be hard to do; we've  just never needed it. 
> 
> 
> 2)  If Combust::Redirect is enabled, as it is for most of the sites  and 
> can be for the rest, then you can setup redirects in  the .htredirects 
> file - there's an example on the www site:
> 	http://svn.perl.org/perl.org/docs/live/www/.htredirects 
> 
> The syntax is
>   regexp   target_url  options 
> 
> options can be "perm", "temp" or "intern" (or shortened or longer  version 
> of that). 
> 
> internal gives an internal redirect (not seen by the user)
> permanent a 301 response
> temporary (the default) a 302 response. 
> 
> 
>  - ask 
> 
> -- 
> http://log.perl.org/ - http://askask.com/  - http://develooper.com/ 
> 
> 
Technical Details
Message-ID: <20070709194742.68640.qmail@spout.spiders.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-perl.combust.users.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!nntp.perl.org
References: <20070709174453.44903.qmail@spout.spiders.net> <0D00380C-4573-4AEB-87FD-0F84BA6297A0@perl.org>

Show Full Headers
Complete Article Headers
Message-ID: <20070709194742.68640.qmail@spout.spiders.net>
Subject: Re: HTTP Redirect
Date: Mon, 09 Jul 2007 15:47:42 -0400
From: will@coleda.com (Will Coleda)
References: <20070709174453.44903.qmail@spout.spiders.net> <0D00380C-4573-4AEB-87FD-0F84BA6297A0@perl.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-perl.combust.users.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!nntp.perl.org
Newsgroups: perl.combust.users
Return-Path: <will@coleda.com>
Mailing-List: contact combust-users-help@perl.org; run by ezmlm
Delivered-To: mailing list combust-users@perl.org
Delivered-To: combust-users@perl.org
X-Spam-Status: No, hits=-2.6 required=8.0
 tests=BAYES_00,DKIM_POLICY_SIGNSOME,DK_POLICY_SIGNSOME,SPF_PASS
X-Spam-Check-By: la.mx.develooper.com
Received-SPF: pass (x1.develooper.com: local policy)
 by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP;
In-Reply-To: <0D00380C-4573-4AEB-87FD-0F84BA6297A0@perl.org>
To: Ask Bjørn Hansen <ask@perl.org>
Cc: combust-users@perl.org
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
Approved: news@nntp.perl.org
Lines: 49