
ManagedLinks
New User
Sep 30, 2005, 1:35 AM
Post #1 of 4
(13280 views)
|
Seems simple enough how do I redirect old cgi scripts to mod perl?
|
Can't Post
|
|
Ok here's the problem. after installing mod_perl I placed the script I wanted to run into the perl directory called it and all worked swimmingly. The script is called by lots of clients on different web servers So I cannot easilly change the location of the script to /perl/ an easy fix or so I thought was to rewrite the url using mod rewrite so that the server would look for the script in the correct directory (/perl/) rather than the requested directory (/cgi-bin/) I inserted this into httpd.conf in the virtual server configuration
#redirect mlserver requests to the faster mod_perl RewriteEngine on RewriteRule ^/cgi-bin/mlserver.pl(.*) /perl/mlserver.pl$1 Bonza it worked but then I realised it was still running under CGI not mod_perl ! Now I cannot find a way to get the script running under mod_perl. CGI always takes over! if I remove the shebang line the script fails if I call it directly ie: server.com/perl/mlserver.pl it works correctly under mod_perl How can I redirect an incoming request to the new mod_perl script? I know this question is probably more an apache one, but I hope someone here can assist I have tried renaming the script to mlserver.perl and the setting a new handler ie: AddHandler perl-script .perl but all that does is send back plain text, it doesn't execute mod_perl at all Any ideas apart from telling all my clients to change the code on hundreds of sites?
|