Page 1 of 1

parsing html docs with php

Posted: Wed May 24, 2006 6:40 pm
by mjmacarty
So am I correct in assuming, creating a .htaccess file with the following:

AddType x-mapp-php4 .html .htm


will allow php code in a .html file to be executed (i.e. index.html)?

IS this pretty much the best solution if you have code in your index file that needs executing?

I know this is kind of basic, but I just need some reassurance! After all I am a code baby.

Posted: Wed May 24, 2006 6:56 pm
by Citizen
Why dont yo just name your index as index.php?

Any index.whatever will count as your index file.

Posted: Wed May 24, 2006 8:28 pm
by mjmacarty
Ok. Thanks. But this doesn't work on my development server. Is there a switch httpd.conf file for Apache?

Posted: Wed May 24, 2006 9:17 pm
by feyd
The normal command for AddType is

Code: Select all

AddType application/x-httpd-php .html
http://httpd.apache.org/docs/trunk/mod/ ... ml#addtype

Index files are set with the DirectoryIndex directive in the conf or .htaccess files. http://httpd.apache.org/docs/2.2/mod/mo ... ctoryindex

Posted: Thu May 25, 2006 6:43 am
by mjmacarty
Thanks!