Processing HTML Pages As PHP 4

Phillip created popular HTML pages that I wanted to add PHP code to, to track the number of hits they’ve been getting. I didn’t want to change the file’s extension or use redirection, so I wondered if it was possible for Apache to treat HTML files as PHP files; it is: add the following to your httpd.conf file:

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

Works like a charm. You could use that technique to hide the fact that your website is using PHP to process your pages.

4 thoughts on “Processing HTML Pages As PHP

  1. Reply Phillp May 16,2005 9:31 pm

    Wow, I don’t know what you’re talking about. But I really need to update that Podcasting on a Budget page. Half the links don’t work anymore.

  2. Reply ChrisO May 18,2005 5:01 pm

    I’m glad i’m not the only one who mistypes possible like tha all the time… :)

  3. Reply ChrisO May 18,2005 5:01 pm

    THAT. damnit! :(

  4. Reply Jody May 18,2005 5:51 pm

    I gotta learn to read what I write.

Leave a Reply