Forum Moderators: mack
Now I would like to add some blog content on other pages throughout the website. However, I don't want to change all of the .htm extensions to .php extensions. There are too many of them and too many interpage links.
I discovered some code to put into a .htaccess file which is supposed to cause HTML pages to be parsed as if there are PHP pages whether or not they have any PHP content. This seemed ideal. I created a .htaccess file (there wasn't already one) and put this into it.
--------------
addtype application/x-httpd.php .php
addtype application/x-httpd.php .html
addtype application/x-httpd.php .htm
--------------
I know nothing about .htaccess, but I saw many sites that recommended this (or similar htaccess code) as a solution to my problem. So far, so good.
However, as soon as I placed the .htaccess file in the root of my website server (same folder where the homepage is), I immediately had a problem with content in an iframe. Instead of displaying the content in the iframe properly, as it always had done, FoxPro put up a dialogue box asking if I wanted to ignore the file (the HTML file to be loaded into the iframe) or if I wanted to download it. If I selected download, then the file was displayed in a separate tab of the FireFox browser.
Obviously, this is no good. Is there a way to show content in iframes and at the same time include PHP content on HTML pages (pages with .htm extensions) using .htaccess to the server to parse the HTML files as if they are PHP files?
Many thanks,
GSJ
Alternatively, you may want to try addhandler instead of addtype:
AddHandler application/x-httpd-php .php .htm .html
Using "application/x-httpd-php" caused the problem with the iframes
Just to clarify, I mentioned this because in the example you posted first there's a dot in 'x-httpd.php' whereas on the servers I use all three words are separated by hyphens.