I have a simple website with a common header and footer hosted on www.netnation.com. Instead of duplicating the common bits on every page and creating a maintenance nightmare, I opted to use php include statements. The problem was I don't particulary want to bother users with the implementation details, so I want my URLs to end with ".html" (not ".php"). After racking my brains out and trying every combination I could find on Google, it turns out the following is the magic incarnation:
AddHandler php-script .html
Action php-script /cgi-bin/php
Put those lines in your .htaccess file (in every directory), and your embedded php script in .html files will be parsed correctly.
If anyone knows why this works and the other stuff doesn't, please feel free to educate me and future visitors by commenting.
Posted by: Chris G. | 2007.08.22 at 04:20 PM
Posted by: Php Scripts | 2008.05.15 at 02:25 AM
Posted by: Arasu | 2008.09.30 at 07:49 AM
Posted by: Ravinesh Raj | 2009.05.01 at 04:31 AM