Perl CGI and URL rewriting returning source instead of execution





Hi,

I have a perl cgi application, not mod_perl, but an actual .cgi application running under apache on OS X.

As many web apps, it makes use of some long get requests with variable labels and values. For example:

http://server.com/cgi-bin/app.cgi?t=new.htm&c=jlpnew.html

I wrote a working url mod_rewrite rule for apache, but instead of the .cgi executing, it just returns the source code of the cgi.

Here are the rewrite rules:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteLog /Users/flint/logs/mod_rewrite_log
RewriteLogLevel 8
RewriteRule ^/showpage/([0-9]+)$ /cgi-bin/app.cgi?c=pc2.htm&b=photo_db&UID=$1
RewriteRule ^/showimage/([0-9]+)$ /cgi-bin/app.cgi?c=pc2.htm&b=photo_db&UID=$1

Any idea what I am doing wrong, why it just returns the cgi source text? It works fine with the actual urls, so I know everything is working normally, just not with the rewrite rule.

Thank you in advance, and I will be sure to summarize and post the solution when I get it worked out.

Regards,
Blake
.



Relevant Pages

  • Re: mod_rewrite : redirecting all pages to another set
    ... the wished page will soon appear in the main browser window ... I have already the javascript code which does the above, using a cookie, ... (the CGI receives the url of the page to be shown in the QUERY_STRING ... RewriteEngine on ...
    (comp.infosystems.www.authoring.html)
  • Re: How !isset in Ruby
    ... Working example Ruby CGI Basic Authorization ... Add this in you .htaccess ... RewriteEngine on ...
    (comp.lang.ruby)
  • Re: dynamic lib ignored even after "found" in "install_driver(Oracle) failed: Cant load..." cgi prob
    ... the solution i found is this: i moved the directory containing libclntsh.so under /usr/lib, which is a location that apache seems to trust, as opposed to where i had originally placed this directory. ... so, if i knew then what i know now, here are the steps _I_ would use were i to install the oracle instantclient such that the DBD::Oracle module would work when used in an apache 2.0 CGI: ... i also could run it this way by placing tnsnames.ora in my home directory as .tnsnames.ora, but this location will do me no good when i want apache to run the script as a cgi. ... am i missing some sort of configuration detail regarding apache and permissions granted a cgi? ...
    (perl.dbi.users)
  • Re: CGIs & CSS - References
    ... my $q = new CGI; ... > If the link tag method is considered to be sufficient, then hey, I'm ... (Naturally the stylesheets and js files are in both ... This makes me think it's Apache. ...
    (perl.beginners)
  • Re: Apache and Perl in Windows
    ... The cgi scripts execute, ... I am studying a spider book that uses Perl so I ... > file in apache and rename the jar files in the server directory. ...
    (comp.lang.perl.misc)