Useful Links
Exclusive Affiliate-Only Offer: $9.99 Domain Names

|
Added on 2008-01-13 |
| Clicks 10003 |
| Rating: 3.88 out of 5 from 53 raters |
In this tutorial I recommended to use .php extension so far because it won't work other ways .But if your have a website with static pages ,this can be a problem ,you'd have to rename all your pages and also you don't want to loose the search engine ranking of your html pages, so if you want to add PHP functionality and dynamicity to it,read the following article and the PHP code will work on HTML pages and you won't have tons of broken links.But, careful. Thou, from the moment you do this configuration ,everything between <?php and ?> will be considered as PHP by the parser.
On Apache Servers
To force Apache to run PHP code on .HTML/HTM pages is very simple.If you have
your website hosted on a remote webserver,download the .htaccess file from the
root web folder and add the following rows:
AddType application/x-httd-php .html
AddType application/x-httd-php .htm
Then upload the .htaccess back
to the server.
If you have Apache running on your computer,open the httpd.conf file
with notepad ,find the Add Type section and add the following rows
AddType application/x-httd-php .html
AddType application/x-httd-php .htm
Then save the file and close
it.
On IIS Web Servers
From now on anything in your HTML/HTM pages between the tags <? ?> will be recognized by IIS as PHP code .To check it,try to apply to the include example at the beginning of this article.Do all exactly the same but change the extension of TestInclude2.php in .html.