Re: Serve html file parsed for ssi



Alice wrote:
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@xxxxxxxxxxxxx> wrote in message news:VuednZKYPYvINqnbnZ2dnUVZ_uTinZ2d@xxxxxxxxxxxxxx
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@xxxxxxxxxxxxx
==================



Actually, I must modify my statement. The correct way is to have a .php extension for those files which have PHP, and .html or .shtml extension for those which have html only (depending on your server configuration). Use SSI in your .(s)html files and php in your .php files.

But you seem to be stuck with a mishmash of both. So handling it in your Apache configuration is the better way to go.

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



Relevant Pages

  • Re: PHP5 IIS Setup
    ... If there were any html tags, ... Incidentally I'm using Apache 2, ... You haven't added a type association so Apache knows to use PHP to process ... it not processing PHP files. ...
    (alt.php)
  • Re: Content negotiation in Apache
    ... >Someone already mentioned the rewriting rules which will work for you. ... Sorry I hadn't posted anything in awhile, but Apache and I move ... The other is that I'm learning PHP and did not originally have the ... and got 600 visitors this December, and the page ends in ".html" and now ...
    (RedHat)
  • Re: PHP-Yes, HTML-No --- Why?
    ... Surely a dynamic web server should appear exactly the same as a static one - all files that contain HTML when viewed should be called ... If you know how, say, the PHP apache module works, you'll see that the hit is ... Apache was designed to do just this. ...
    (comp.lang.php)
  • Re: How do we get there from here?
    ... > then sub the whole of that generated markup into the template? ... layed out on the fly, a simple IMG tag, or even an entire HTML document. ... PHP scripting provides 10 times the features of both of these ... idea as tokens can eliminate a huge amount of maintance, ...
    (comp.databases.pick)
  • Re: query string passing woes........ help... please....
    ... |> | offer any help other than saying that my validation could be FAR more ... I'm a total newbie at php. ... The easiest way for you would be to make the html form called form.php ... $_SESSION array using the same names. ...
    (alt.php)