php to shtml .htaccess file

6 posts by 3 authors in: Forums > CMS Builder
Last Post: September 28, 2009   (RSS)

Hi

I was recently using the command

"Addhandler application/x-httpd-php .shtml .php"

in the .htaccess file for my CMS Builder website and recently my Hosts moved my site to a new server and the page wasn't being displayed and only showing the code of the website instead of the proper output.

They told me that I need to change it to the following command:

"AddHandler php5-cgi .shtml .php"

While the php data loads, the SSI doesn't. I've been sending emails back and forth for three days now and I can't seem to resolve this problem.

Any idea what else I can try?

Thanks.

Re: [ColinW-O] php to shtml .htaccess file

By Chris - September 23, 2009

Hi ColinW-O,

Is the problem that you're using SSI includes and your new server doesn't support them? You could try replacing your SSI includes with PHP includes:

<!--#include file="more.html"-->
<?php include "more.html"; ?>

That's more or less a guess though. Your host should know what the problem and solution are.
All the best,
Chris

Re: [chris] php to shtml .htaccess file

Well SSI works if I empty the .htaccess file; they're just not working together that's the odd thing.

Using PHP include works but that means I have to edit all files manually now :)

Re: [ColinW-O] php to shtml .htaccess file

By Dave - September 28, 2009

It's actually unusual that they would have both been working before. Usually it's one of the other (PHP or SSIs).

I think there is a way to do that but you'd have to check with the host as to how they how Apache configured on the old server that allowed that.

Another thing to keep in mind if both are enabled is there may be a security risk if the SSIs are processed after PHP, because anyone who can add content to the site could add a SSI tag and have it executed.

Hope that helps, let us know how it turns out.
Dave Edis - Senior Developer
interactivetools.com

Re: [ColinW-O] php to shtml .htaccess file

By Dave - September 28, 2009

Ok, good to hear. Thanks for posting back to let us know it's all working now. :)
Dave Edis - Senior Developer
interactivetools.com