in reply to How do I get cgi scripts parsed for ssi by way of the .htaccess file?

If you are trying to have the results of a CGI file (that being an HTML stream) re-parsed to handle SSI directives, you cannot do it; the CGI output is sent directly from the script to the outside connection, and no further parsing is done by the web server. Instead, you need to do the parsing during the CGI output generation, typically with a module like CGI::SSI or the like.

  • Comment on Re: How do I get cgi scripts parsed for ssi by way of the .htaccess file?

Replies are listed 'Best First'.
Re: Answer: How do I get cgi scripts parsed for ssi by way of the .htaccess file?
by Anonymous Monk on May 31, 2001 at 02:04 UTC
    I tried CGI::SSI, but when I do an exec i get "An error has occured" or whatever. Then i tried an include virtual and I got the source code of the script (dont ask me how that happened). the script is chmodded 755, all the paths are right, so I dunno what's wrong...
      You may need   Option +Includes in your .htaccess . Then,   <!--#exec cmd="./foo.pl"--> will work. CGI-style exec is left as an exercise (it's there in the Apache docs).

        well, i tried that, and all i get is 500 errors...my server's running on FreeBSD btw

        ______________________________________________
        When I get a little money, I buy books. If I have any left over, I buy food and clothes.
        -Erasmus

      It probably would be helpful to post the code that you are working with so that we can find what errors you might have.
      Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
        The code in my script for using CGI::SSI is: use CGI::SSI (autotie => STDOUT); # to tie the ssi parsing to STDOUT and the actual ssi directive: <!--#exec cgi="/cgi-bin/ads/ads.cgi" -->

        ______________________________________________
        When I get a little money, I buy books. If I have any left over, I buy food and clothes.
        -Erasmus