[catalyst] status 301 changed to 200 only when deployed with fastcgi/lighty

Daniel McBrearty danielmcbrearty at gmail.com
Tue Sep 25 20:11:31 GMT 2007


I resolved this by using the more usual

$c->res->redirect( $r, 301 );



On 9/24/07, Daniel McBrearty <danielmcbrearty at gmail.com> wrote:
> Hi
>
> I finally deployed engoi.com live last night, after some protracted
> bug fixing and stuff
>
> One of the things I have in the site is a module which takes URL's for
> the old site and sends back a status 301 with a redirect to the new
> url for the same page.
>
> For example: if the user requests
>
> /public/index.cgm?natlang=nl
>
> they get a 301 and redirect to
>
> /nl/index.html
>
> The code to do this looks (in part) like this;
>
> my $r = "/$natlang/index.html";
> $c->stash->{redirect} = $r;
> $c->res->status( 301, $r );
> $c->stash->{template} = '/redirect/redirect.tt';
>
> And this works fine on the dev server.
>
> WHen deployed with lighty/fastcgi, it also works fine - *except* that
> the status code now becomes a '200'. My $c->res->status( 301, $r ) is
> silently ignored.
>
> My lighty deployment is basically a variation on this:
>
> http://www.dev411.com/wiki/Installing_lighttpd_and_FastCGI_for_Catalyst
>
> my lighttpd.conf section is a little different :
>
> $HTTP["url"] !~ "\.(html|css|js|png|gif|ico)$" {
>     fastcgi.server = (
>         "" => ( "Engoi" => ( "socket" => "/tmp/engoi.socket",
>                              "check-local" => "disable")
>               ),
>         ".cgm" => ( "Engoi" => ( "socket" => "/tmp/engoi.socket",
>                              "check-local" => "disable")
>               )
>         )
> }
>
> Has anyone any idea why my status code should be silently changed?
>
> thanks
>
> Daniel
>
>
>
> --
> Daniel McBrearty
> email : danielmcbrearty at gmail.com
> http://www.engoi.com
> http://danmcb.vox.com
> http://danmcb.blogger.com
> find me on linkedin and facebook
> BTW : 0873928131
>


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
http://www.engoi.com
http://danmcb.vox.com
http://danmcb.blogger.com
find me on linkedin and facebook
BTW : 0873928131



More information about the Catalyst mailing list