janos.gonzales Posted March 12, 2008 Share Posted March 12, 2008 Hi, I realize this is a PHP forum, and I'm asking a Perl question. But this is really an Apache question so don't get mad please . I am trying to build a CGI script so that when my Apache server is asked for <b>http://myserver.com/test/123.pdf</b> then the CGI script fires up and serves the file. The reason for this is that the file does not really exist in the 'test' folder at all but on a different machine. I figured out how to get the CGI script to copy this file and serve it and 'fool' the browser into thinking it's loading a PDF. What I need now is for the address in the url to be <b>http://myserver.com/test/123.pdf</b> not <b>http://myserver.com/test/script.pl</b> . This is so that when the file is saved it's saved with its real name not as a PDF with a wrong .pl extension. Do I have to use mod_perl for this? Or is there an easier way? Link to comment https://forums.phpfreaks.com/topic/95872-mod_perl-behavior/ Share on other sites More sharing options...
janos.gonzales Posted March 12, 2008 Author Share Posted March 12, 2008 Nevermind! I got it figured out. I just use Apache's Action directive (http://httpd.apache.org/docs/1.3/mod/mod_actions.html#action) AddHandler my-file-type .pdf Action my-file-type /scripts/scrip.pl Link to comment https://forums.phpfreaks.com/topic/95872-mod_perl-behavior/#findComment-490837 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.