Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

php in a html page, which has ssi

Hi there :-)
here's a tricky one...
I got this html page which contains some ssi which work fine.
I also just got some php on that html page and it's not being processed...

I added in the line to my htaccess
AddType application/x-httpd-php .html

but still no go, and that is because I have these lines in there (so the ssi get processed)

AddType text/html .html
AddHandler server-parsed .html

Soo my htaccess looks like this
AddType application/x-httpd-php .html
AddType text/html .html
AddHandler server-parsed .html

If I have only the
AddType application/x-httpd-php .html

in my htaccess the php goes fine.

How can I get the php and ssi to work in harmony?
0
wildzero
Asked:
wildzero
  • 2
3 Solutions
 
soapergemCommented:
Is there a reason you have to use the .html extension for these files? If nothing else, couldn't you save them as .php files, and then use mod_rewrite (in Apache) to make them *appear to be* .html files?
0
 
soapergemCommented:
And if nothing else, you could always just use PHP to include the files, instead of using SSI.

Something like this:

    <html>
    <?php
    include('./page2.html');
    ?>
    </html>
0
 
HackneyCabCommented:
You can't use SSI and PHP in one file served by Apache 1.3.

Apache 2 is supposed to be able to do this, but I don't use Apache 2, so I can't test this.

Just do as soapergem says, and use PHP's include or require statement to load content into a page.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now