Convert entire HTML site to PHP without changing *.html extensions

 

You want to switch your HTML site to PHP, but don't want to go and change every single file extension from htm/html to php?

 

It is simple. Just follow this procedure:

 

1) be sure your server is Apache with PHP enabled

2) open the .htaccess file in the root folder (something like www, htdocs, public_html or similar...)

3) add this line:

 

 

4) Now - open some html page and add few php lines to test the result. For example:

 

<?php echo "test"; ?>

 

5) If everything is OK, all *.html pages will work as standard *.php pages

 

(Just note that this may not work on every server/configuration)

 

As a demo -- the bold text below is produced by one <?php echo "<b>This is PHP Generated Output ..</b>."; ?> line:

This is PHP Generated Output ...

 

 

More HowTo Resources