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

Daniel McBrearty danielmcbrearty at gmail.com
Mon Sep 24 22:31:58 GMT 2007


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


they get a 301 and redirect to


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:


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?



Daniel McBrearty
email : danielmcbrearty at gmail.com
find me on linkedin and facebook
BTW : 0873928131

More information about the Catalyst mailing list