May 16 2005

Processing HTML Pages As PHP

Jody posted this at 9:14 pm under internet & computers

Phillip created popular HTML pages (Podcasting On A Budget, for example) 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 Responses to “Processing HTML Pages As PHP”. Leave a Reply.

  1. Phillpon 16 May 2005 at 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. ChrisOon 18 May 2005 at 5:01 pm

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

  3. ChrisOon 18 May 2005 at 5:01 pm

    THAT. damnit! :(

  4. Jodyon 18 May 2005 at 5:51 pm

    I gotta learn to read what I write.

Comments RSS

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: This post is over 3 years old. You may want to check later in this blog to see if there is new information relevant to your comment.

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.