faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 21 people (62%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How do I turn a php script into index.html

Mar 1st, 2009 08:58
Sarah Turner, healthy man, Philip Olson, Paul,


This question could have a few different meanings so we'll cover both.  
First, the key here is the extension and of course .html is the 
extension of index.html  For the web server to have PHP process 
the .html extension you must tell it to do so.  For Apache the 
following is a common configuration in httpd.conf:
  AddType application/x-httpd-php .php .php3 .phtml
That will have PHP parse .php .php3 and .phtml extensions.  In order to 
have .html you could simply add it:
  AddType application/x-httpd-php .php .php3 .phtml .html .example
As an example we made it so .example extensions also parse PHP, feel 
free to remove that.  Save, restart Apache, and now all .html files 
(such as index.html) will be parsed as PHP.
Now let's say you don't want the overhead of parsing ALL .html files as 
PHP but rather you want your web server to look for index.php in the 
directory and load it if it exists, you could do the following in your 
httpd.conf
  DirectoryIndex index.php index.html index.htm example.php
That will first look for index.php, then index.html, then index.htm, 
then example.php, in that order.  Feel free to remove or add as you see 
fit.
http://www.healthbyhealth.com
http://www.healthment.com
http://www.mesotheliomadown.com
http://www.mesotheliomaout.com
http://www.pickarticle.com
http://voyagevacances.blogtact.com/
http://rejseferie.blogtact.com/
http://flyvningertilschweiz.blogtact.com/
http://volssuisse.blogtact.com/
http://volsromeitalie.blogtact.com/
http://viajesvacaciones.blogtact.com/
http://reisenchina.blogtact.com/
http://flugeschweiz.blogtact.com/
http://resasemester.blogtact.com/
http://viaggivacanze.blogtact.com/
http://reisenurlaub.blogtact.com/
http://reizenvakanties.blogtact.com/
http://volisvizzera.blogtact.com/
http://gartenpflege.blogtact.com/
http://geschenkideeen.blogtact.com/
http://vluchtenromeitalie.blogtact.com/