Forum Moderators: coopster
AddType application/x-httpd-php .php .php3 .phtml .html .htm
I added an .htaccess file with the above statement in it, to a directory.
This directory contains my header.php file, which I have now renamed to header.html.
I thought it would parse header.html containing php code and come out alright.
Mozilla tells me it doesnt know how to handle it. What did I screw up?
ForceType directive instead of AddType. It could also be because the server doesn't allow .htaccess changes for that directory. Or it could be a Mozilla issue. Can't do much in those cases.
Not sure what else might cause the problem.
Sort of OT, but is worth mentioning...you probably don't want to set the mimetype for the html extension to be processed by PHP for a couple reasons: PHP may throw errors for regular HTML documents (e.g., the <?xml...?> declaration will throw PHP for a loop); and your server overhead will be much higher since every html document served -- PHP or not -- will be passed through the PHP interpreter.
Jordan
you probably don't want to set the mimetype for the html extension to be processed by PHP
Yes. I don't really want to.... I have a pearl/cgi script that wants me to put an HTML header and footer on it (it lets me set the path to the header and footer) but I want to use my php header and footer, and trying to figure out a way to do that.
I've been searching message forums and php org for 3 days now....
If you have a thought on this I am certainly listening!
did you read this thread as well?
does a php "include" command work in a html file? [webmasterworld.com]
AddHandler could also be the problem