Forum Moderators: open

Message Too Old, No Replies

How to use php and SSI on the same file?

         

sodani

12:22 am on Feb 9, 2007 (gmt 0)

10+ Year Member



I'd like to use server-side-includes in a particular file, which would require the extension .shtml, but I also want to use php within in - .php. Is there a way for me to do both? Am I going about this the wrong way?

abbeyvet

1:25 am on Feb 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not use PHP includes and make them .php pages?

sodani

8:13 pm on Feb 9, 2007 (gmt 0)

10+ Year Member



yeah I suppose I can do that. It's just a lot of pages that I'd have to update, and then I would have to redirect the .shtml urls to .php. Ah well.

penders

4:06 pm on Feb 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can you configure your server to parse .shtml files for PHP, as you can other file extensions (via the httpd.conf / .htaccess file on Apache)...?

Such as...
[webmasterworld.com...]
[webmasterworld.com...]

sodani

11:09 pm on Feb 10, 2007 (gmt 0)

10+ Year Member



This site is on shared hosting, so I don't think I can make that configuration change.

penders

8:48 am on Feb 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



... but if it's possible to make this 'configuration change' by just adding a line to an .htaccess file (as suggested in the above threads) - which can reside in any directory and *should* be possible to edit on a shared hosting account - then I would have thought this might be possible...? (In theory anyway... I have not tried this)

coopster

10:36 pm on Feb 18, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



A couple of other related threads that might be helpful:

Parse HTML or not [webmasterworld.com]
When parsing SSI's, PHP files don't work [webmasterworld.com]