开发者

PHP script to replace cgi script

开发者 https://www.devze.com 2022-12-29 03:10 出处:网络
I have a CGI script that uses an old开发者_Go百科 database driver that is no longer supported. Instead of struggling with this old cgi script, I thought it would be easier to rewrite it in php. It wor

I have a CGI script that uses an old开发者_Go百科 database driver that is no longer supported. Instead of struggling with this old cgi script, I thought it would be easier to rewrite it in php. It works now as a php script, but I need it to be served from the same web address. When a user accesses http://somesite.com/myscript.cgi, I want it to run the php script. I tried just renaming the php script with .cgi, but that didn't work. This is on an Apache server hosted by Dreamhost. Any advice?

  • Bridger Maxwell


create .htaccess file with content

RewriteEngine On
RewriteRule ^myscript.cgi  /myscript.php

Read more about Mod_rewrite and examples

0

精彩评论

暂无评论...
验证码 换一张
取 消