php to shtml .htaccess file

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

By ColinW-O - September 23, 2009

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: [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: [Dave] php to shtml .htaccess file

By ColinW-O - September 28, 2009

I used the <?php include "more.html"; ?> code rather than the usual SSI include tag. I edited each file manually.

Oh well. It didn't take as much as I thought!

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