Forum Moderators: coopster

Message Too Old, No Replies

The php file extension

Is it necessary?

         

jfodale

3:55 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



My site is currently built on almost 99% of old .shtml files - I use some simple SSI on every page and it has worked pretty well for years by just manually updating everything (inefficient or not, I love creating sites by hand for whatever reason).

Is there anyway to run php from within .shtml files without changing the extension to .php?

Thanks

mehh

4:29 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



Yes. If you're using Apache you'll want something like this in a .htaccess file:
AddType application/x-httpd-php .shtml .htm .html

for more information on this sort of thing look in the apache forum [webmasterworld.com] no idea about other severs though

henry0

5:24 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may also do the same by updating your httpd conf
and restarting Apache
However you need to be sure to have an easy access to it and reload a saved httpd in case of problem.

Due to specific server conf
the wording could be more or less similar
and it could result in the Apache version of the BSOD :)
Ask your ISP for the correct wording

jfodale

5:30 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



Excellent, thanks much you two.