Possible Duplicate:
How do I add PHP code to .html files?
is there a way to process php code on a .html/.htm file? the server supports php I just need the file to retain the .htm extension
Note: I really don't understand why some users feel the need to down vote on a valid question. Not all questions appear in the search unless it worded close to the previous question.
Thanks for all the answers below. AddType
in the htaccess solved my problem
Add the following to your .htaccess:
AddHandler application/x-httpd-php5 .htm
You can either use mod_rewrite
, or add a directive to your .htaccess file to tell Apache (if that's what you're using) to add .htm as a PHP file type.
You can change the file config of your web server (for example, in apache the httpd.conf file) to interprete the .htm as it was a php file.
If you use Apache, look for the php addHandler directive in the apache2.conf
file and add your extension in the list. Do not forget to restart apache after.