Page 1 of 1

parse .html files as .php

PostPosted: 13. April 2009 19:25
by morfie
I know there is a way to do this. Ive searched through 10 pages of search results and still can find it.

I have php code in a .html file and i just want .html files to be parsed as .php. Can someone please tell me where in the php.ini or in the httpd.conf file i need to set something.

I tried adding below to the .conf file but it didn't work.

AddType application/x-httpd-php .html

Thanks

morfie

Re: parse .html files as .php

PostPosted: 13. April 2009 20:19
by Wiedmann
PHP is configured in "httpd-xampp.conf".

Re: parse .html files as .php

PostPosted: 13. April 2009 20:38
by morfie
this was a good information that i did not know but still not working.

I changed

AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml
to
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .html

in the C:\xampp\apache\conf\extra\httpd-xampp.conf file. Restarted my apache and still doesnt work.

Any other ideas?

Re: parse .html files as .php

PostPosted: 13. April 2009 21:09
by morfie
i figured it out! I added a line that says

AddHandler application/x-httpd-php .html

to httpd-xampp.conf and it worked. Adding .html to the line

AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml

didnt really help. :s


Hope this helps someone else.