Forum Moderators: phranque

Message Too Old, No Replies

How can I get .shtml pages through the php parser?

         

Oliver Henniges

12:34 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For some obscure reason a friend of mine has quite a number of well-indexed pages with an .shtml-ending. It is NOT necessary to open these with a secure https-request! He was just trying to do something >erm< "unique" ages ago;)

Now he is starting with php. For his normal html-pagges an entry like

AddType x-mapp-php4 .html

in his .htaccess-file works perfectly fine, but an additional

AddType x-mapp-php4 .shtml

does not make the .shtml-pagges get parsed. On his shared webspace he has no access to httpd.conf. Any idea?

Any help is well appreciated.

topr8

12:40 pm on Jan 25, 2007 (gmt 0)

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



>>It is NOT necessary to open these with a secure https-request!

.shtml and .shtm

are filenames usually associated with server side includes on an iis web server

jdMorgan

5:02 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, don't confuse SSL (Secure Sockets Layer) with SSI (Server-Side Includes).

Filetypes .shtm and .shtml refer to files which need to be parsed for server-side includes (on either IIS or Apache, and probably many other less-popular servers as well).

For more information on making SSI and PHP co-exist, try this search [google.com].

Jim

Oliver Henniges

6:09 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thx, I confused that.

Indeed he had been using some ssi-templates (so that was the obscure reason), which in fact will not be nescessary once running php, because he might be able to do the same with echo inside an include-routine.

Now what should he add to his .htaccess?
Will it work once the ssi-includes are deleted?

LunaC

6:34 pm on Jan 25, 2007 (gmt 0)

10+ Year Member



Do you mean you want .shtml pages to be parsed as php without having to change filenames?

If it is, I do that on one site. All I had to do was add this to the htaccess and it worked like a charm.

AddHandler application/x-httpd-php .shtml

Any ssi includes will stop working (did for me anyway), so make sure to thoroughly test that there are none remaining.