For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > April 2007 > Serve html file parsed for ssi









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Serve html file parsed for ssi
Alice

2007-04-29, 7:58 am



How can I make php script serve up an *.html file 'server-parsed' for SSI's?



The goal is to pre-process all *.html files with php script, but the SSI's
need to be handled too. Problem with using 'virtual' is that it creates a
loop via the .htaccess handler setting/action.



..htaccess

# Enable SSI

Options +Includes



# HTML Handler

AddHandler HTML .html

Action HTML /HTML.php



HTML.php

<?PHP



<snip>



$file = $_SERVER['PATH_TRANSLATED'];

include $file;

?>




Jerry Stuckle

2007-04-29, 6:59 pm

Alice wrote:
> How can I make php script serve up an *.html file 'server-parsed' for SSI's?
>
>
>
> The goal is to pre-process all *.html files with php script, but the SSI's
> need to be handled too. Problem with using 'virtual' is that it creates a
> loop via the .htaccess handler setting/action.
>
>
>
> .htaccess
>
> # Enable SSI
>
> Options +Includes
>
>
>
> # HTML Handler
>
> AddHandler HTML .html
>
> Action HTML /HTML.php
>
>
>
> HTML.php
>
> <?PHP
>
>
>
> <snip>
>
>
>
> $file = $_SERVER['PATH_TRANSLATED'];
>
> include $file;
>
> ?>
>
>
>
>


A terrible approach. But just set your apache configuration up to parse
html files through both.

Try alt.apache.configuration for more info.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Alice

2007-04-29, 6:59 pm

I'm not the machine admin. So I don't know how I would be able to configure
Apache to parse html files through both.

There has got to be a way to do this.


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:VuednZKYPYvINqnbnZ2dnUVZ_uTinZ2d@co
mcast.com...
> Alice wrote:
>
> A terrible approach. But just set your apache configuration up to parse
> html files through both.
>
> Try alt.apache.configuration for more info.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com