homepage Welcome to WebmasterWorld Guest from 54.205.241.107
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Rewrite rule problem with cgi-bin
dawlish

10+ Year Member



 
Msg#: 3957 posted 4:59 pm on Feb 7, 2005 (gmt 0)

I am trying to use a rewrite rule in order to generate friendlier urls for script generated database content using the following

RewriteRule "^/page-([0-9]+)\.html$" /home/httpd/vhosts/site14/cgi-bin/script.pl?action=form&fid=$1

However, all that seems to be happen is the script code returned in the browser rather than the script generated content.

e.g. clicking on 123456.html does not return the appropriate record in the database formatted correctly, instead the perl code of the script is returned in the browser.

I'd very much appreciate any advice or suggestions.

Thanks

 

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3957 posted 7:42 pm on Feb 7, 2005 (gmt 0)

What happens if you key the url in with the get query string (comment out your RewriteRule for now)? Does it parse the cgi script correctly?

dawlish

10+ Year Member



 
Msg#: 3957 posted 10:07 pm on Feb 7, 2005 (gmt 0)

The script works fine when I run from a browser using the full query string rather than the rewritten url. When I run the rewritten url it just outputs actually script code rather than parsing

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3957 posted 11:20 pm on Feb 7, 2005 (gmt 0)

It's not parsing because you have specified a MIME-type of "html". Force the MIME-type of the target file to be the correct MIME-type for your cgi installation. For example,

RewriteRule "^/page-([0-9]+)\.html$" /home/httpd/vhosts/site14/cgi-bin/script.pl?action=form&fid=$1 [T=application/x-httpd-cgi,L]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved