[Catalyst] FastCGI url handling

Carl Franks fireartist at gmail.com
Wed Nov 23 13:43:06 CET 2005


On 23/11/05, Jules Bean <jules at jellybean.co.uk> wrote:
>
> I haven't used that precise setup, but if it was just plain CGI, I'd
> expect the following URL to work:
>
> /myapp/test.cgi/products
>
> ...have you tried variations on that theme?
>

That's great - that did work.

I've done some further experimentation to get it to work without an
.ext in the url.

First I renamed test.cgi to test - and that worked as expected.
However, that requires 2 names before the query string; '/myapp/test/'

Getting only 1 name '/myapp/' before the query string wouldn't be as
simple as moving the script /myapp/test to /test - as that would
require 'SetHandler' in the root .htaccess which would interfere with
the serving of other static files.

Next I tried using RewriteRule
I tried setting
RewriteRule ^/myapp/(.*) /cgi-bin/test.cgi/$1
in the root .htaccess, but this didn't work - regardless of the
existance or not of any '/myapp' directory, I only this in my errorlog
File does not exist: /home/fireartist/docs/myapp/products

I finally got it working by making the file '/myapp/.htaccess', containly only
RewriteEngine on
RewriteRule (.*) /cgi-bin/test.cgi/$1

This satisfies my initial requirement of url's such as
'/myapp/products', and being transparent to the user.

Would it be appropriate for this to be added to "Using FastCGI" in
Catalyst::Manual::Cookbook ?

Carl



More information about the Catalyst mailing list