[Dancer-users] Dancer, Plack, plain old CGI and mod_rewrite

icovnik icovnik at gmail.com
Wed Mar 10 14:49:42 CET 2010


I'm trying to set up a simple app, but unfortunately, it should run as
old CGI script under Apache on Linux.
The CGI script is reachable via http://server/appdir/script.cgi. I
have set appdir/.htaccess like this:

RewriteEngine On
RewriteRule ^(.*)$ script.cgi

The RewriteRule should be probably something like this:

RewriteRule ^(.*)$ script.cgi?$1

The script calls Dancer app via Plack, that part works. Dancer renders
templates just fine. The only problem I have is that the
request->{path} variable is allways set to "/appdir/script.cgi" so my
routes don't work. Can you please point me to correct settings to be
able to make the routes work? The routes looking like this:

get '/apdir/script.cgi?/path/:param' => sub { ... }

would be ok. Even better would be if there was some way to allways
strip the beginning of the path "/apdir/script.cgi?" so I would be
able to write just the interresting part "/path/:param".

Please assume that I am unable to run the application under FCGI or
mod_perl. The Dancer's http server works but I need to make it work on
our server... so... as plain CGI.

Thank you.


More information about the Dancer-users mailing list