Forum Moderators: coopster
I am trying to get the server to parse php in a .html document. I have tried adding the follow to my .htaccess file:
AddType application/x-httpd.php .html .php .htm
addhandler application/x-httpd.php .html .php
Both together and seperately. It just doesn't seem to work. I try to include php echo statements in the .html file but they do not print. I have HTML statements also, and they print fine.
When I add the 'AddType' instruction IE seems to be trying to download the file, because it 'doesn't recognize the format'. I have no idea why it would do that.
Maybe its something wacky with the server, or maybe my browser? I'm not experienced enough with this stuff to know *why* things are not working.
Thanks in advance.
Your Web server may not be set up to listen to .htaccess files.
What is your Web server platform, and is this is your server or a shared host?
Here are 2 recent threads on this subject, which might help:
[webmasterworld.com...]
(I must have read 20 php html threads, but missed that one)
It seems that perhaps I have the same problem as that fellow. This is all a little above my head, as I am decent with php, but all this .htaccess stuff is new to me.
How can I check to see if having SSI enabled is causing the problem I am having?
My .htaccess file is working BTW...
you said
I am trying to get the server to parse php in a .html document. I have tried adding the follow to my .htaccess file:AddType application/x-httpd.php .html .php .htm
addhandler application/x-httpd.php .html .php
But it should be
AddType application/x-httpd-php .html .php .htm
notice the DASH between httpd and php instead of period.
Most servers will work fine with just the AddType command but some require both due to their setups.
Your addhandler syntax was incorrect as well (had the period and not the dash). You may need.
AddType application/x-httpd-php .html
AddHandler x-httpd-php .html
I tried you fixes, and then all combinations. Still no dice. Seems to be doing to same thing...
I tried to contact the hosting service. Man are they aweful. Told me they don't offer support for quetions like that. "First-class" service my eye!
For future reference steer away from godaddy.com They are cheap as hell, and you get what you pay for.