View Full Version : .htaccess AddType addition causes error
chachi
Aug 13th 2004, 4:55 pm
Hi gang. Fired up to get the Ad Network rollin'. I added AddType application/x-httpd-php .htm .html to my .htaccess file and it creates a situation where IE asks if I want to open, save or cancel a file download rather than load the .html pages as usual. Searched around the web for a whilie...found people with the same problem, but nobody had a solution that I have seen yet. Anyone have the solution?
digitalpoint
Aug 13th 2004, 5:01 pm
Sounds like your web server doesn't support PHP in that case...
chachi
Aug 13th 2004, 5:05 pm
That is not the case...there are php pages on that site :)
I am wondering if maybe I need to go into the apache config and do it down there
digitalpoint
Aug 13th 2004, 5:07 pm
Possibly... your setup might not allow certain items to be set within the .htaccess file...
chachi
Aug 13th 2004, 5:09 pm
I'll get to the bottom of this and post the answer here.
chachi
Aug 13th 2004, 5:31 pm
Well, it appears that if SSI is enabled on that server, that you cannot have two "handlers" going at the same time. If you are using server side includes (SSI) with apache, and have added a line:
AddHandler server-parsed .html
in your httpd.conf file so that .html files can use SSI, this setting will prevent
addtype application/x-httpd-php .php .html
from working (.php will work, but .html won't). So, it appears I need to dump SSI support for .html files if I want to get php to work with .html files. The other thing is, a very good friend just told me that I could not include the php in an include file to begin with. I am taking his word at that as he is pretty darn good at what he does. :)
So, that is a bummer. I was going to include the php into a sitewide include I already use for some menus. Anyone have any thoughts?
digitalpoint
Aug 13th 2004, 5:39 pm
Or... you could use the SSI/shtml implementation of the ad network. :)
chachi
Aug 13th 2004, 5:44 pm
and change all of my file extensions? I believe I was incorrect above in my understanding. php will work in an include on a page with a php extension
digitalpoint
Aug 13th 2004, 5:56 pm
Right... You can include a PHP file within a PHP file.
bee bird
Aug 1st 2006, 12:27 am
Addtype application/x-httpd-php .php .html
I try to put that code also in my .htaccess, everything works fine, my hmtl file now works with embeded php code on it:D :D :D
Cudbwrse
Aug 1st 2006, 3:03 pm
You can always do a site wide search and replace and turn all the SSI into php includes? I just did that myself.
waelthmastery
Aug 2nd 2006, 6:26 am
Hi can somebody post teh complete command please?
The original one is
"addtype application/x-httpd-php .php .html "
where does SSI/shtml come in?
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.