Forum Moderators: phranque

Message Too Old, No Replies

Using SSI in dynamically generated pages

Can SSI directive work in dynamically generated pages?

         

Webdetective

5:52 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



If I am using a script that generates dynamic pages on the fly using the following .htaccess code

RewriteEngine on
RewriteCond %{REQUEST_URI} ^.*\.htm$
RewriteRule ^(.+)$ ...........

Is there anyway I can get an SSI directive such as
<!--#exec cgi="/cgi-bin/axs/ax.pl" -->
to work in them? This particular example should vanish from the page's source code when loaded in the browser, except it isn't. I'm not getting any errors, the SSI code simply isn't functioning.
Fred

Span

6:19 pm on Jul 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are your .htm files parsed for SSI directives?

On Apache 1.3 you need this in your .htaccess:

AddHandler server-parsed .htm

Apache 2.0 needs this:

AddOutputFilter INCLUDES .htm

Webdetective

8:05 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



I forgot to mention that. Yes my site is configured to parse SSI for both htm and html files.

I am using this line in .htaccess

AddType text/x-server-parsed-html .html .htm

I have been successfully using SSI for static html pages for a long time.

jdMorgan

8:59 pm on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are using the correct directive as posted by Span, then it's likely to be a problem with module processing order and control flow. The content-handling is a serial process; If you're running a script parser like PERL, then it doesn't have the capability to pass control back to Apache so that Apache can invoke SSI CGI processing.

A better approach may be to make one file that *includes* both script types. This 'flattens' the control into one file, rather than trying to have script type two parsed within a handler for script type one.

I'm sure there are clearer or more technically-correct ways of saying that, so I hope it's clear enough.

Jim