I am having trouble changing my file extension from .php to .html. I have added it to the httpd.conf and that didn't work. Then I made a .htaccess page, and that didn't work. The html pages show up, but the php does not parse.
Can anyone help with this?
2 Questions:
1.) Is PHP installed?
2.) Is there a line like this in your httpd.conf file?
AddType application/x-httpd-php .php
I have this in my config file AddType application/x-httpd-php .php .htm .html
is that right?
Also, i am using apache, it works when i load the .php but when i change the extension to .html, it doesn't parse.
Okay, find all the other AddType lines and see if .html is listed on the others. Might be an overriding issue somewhere in the httpd.conf file.
I'd advise against using .html as a PHP parsed item since every static HTML page will then be run through the PHP parser and that can reduce speed. Perhaps a .pthml extension is better 😉
I'll try it out and let you know. The reason we are using .html is is for tracking purposes. We aren't able to track any pages with the .php extension.
Shouldn't this work?
<IfModule mod_php4.c> #If php is turned on, we repsect .php and .phps files. AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
#Since most users will want index.php to work we #also automatically enable index.php .htm .html <IfModule mod_dir.c> DirectoryIndex index.html index.php </IfModule>
</IfModule>
Yes, that will work. But it won't make your .html pages parsed by the PHP engine; rather, going to www.domain.com/ will bring up either index.html or index.php by default (if available).