By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

Serve html file parsed for ssi

P: n/a


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;

?>


Apr 29 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.
js*******@attglobal.net
==================
Apr 29 '07 #2

P: n/a
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" <js*******@attglobal.netwrote in message
news:Vu******************************@comcast.com. ..
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.
js*******@attglobal.net
==================

Apr 29 '07 #3

P: n/a
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" <js*******@attglobal.netwrote in message
news:Vu******************************@comcast.com. ..
>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.
js*******@attglobal.net
==================

The correct way is to modify your Apache configuration to do it. If you
aren't the server admin, then get the server admin to set it up for you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 29 '07 #4

P: n/a
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" <js*******@attglobal.netwrote in message
news:Vu******************************@comcast.com. ..
>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.
js*******@attglobal.net
==================

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.
js*******@attglobal.net
==================
Apr 29 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.