Parsing HTML with PHP using .HTACCESS

by Chris Abraham on 07/12/2006

PinExt Parsing HTML with PHP using .HTACCESS

I wanted PHP to parse not merely .php but also .html and .htm files on my blog. I added this as a separate line in my web root-level .htaccess file:

AddHandler php-script .php .php4 .php3 .html .htm .phtml

And it seems to work for me. Good luck and hopefully you won’t have to work so hard.


I had tried a load of them — none of these worked, which is why they’re commented out:

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

Thanks to Drak for the help!

PinExt Parsing HTML with PHP using .HTACCESS
Be Sociable, Share!
  • more Parsing HTML with PHP using .HTACCESS

Share on Tumblr

{ 1 comment… read it below or add one }

gavin October 18, 2010 at 19:06

Thank you sir!

I had tried a few other ways, and this is the only one that GoDaddy can use. You saved my bacon.

Reply

Leave a Comment

Previous post:

Next post: