cthackers wrote:I think AlecS was trying to ask about .html seo optimized links. Requests with .html extensions sent to php files because of ModReqrite rules. That makes more sense than embedding php in html static files and making htmls beeing parsed by php interpreter.
Well, I did not see anything in his message about SEO, but since it took me several readings of this thread to finally find the answer to my question, I probably missed it.
I am posting, in this message, what it was that finally made it so that XAMPP/Apache now parses PHP code inside of a HTML file. 99% of my HTML files have PHP code in them, so the argument about "this is not the way you should do it" does not seem to hold water to me. Plus, as I said before, this is a localhost installation only for the purposes of testing my files. Since XAMPP/Apache only runs when I need it, any extra overhead created by making the change below is more than tolerable. BUT, I have not seen any slowdown of my computer, so I really don't get the argument.
1) In c:\xampp\apache\conf\extra find the file: httpd-xampp.conf and open it in your text editor (I like Notepad++).
2) Find the entry: <FilesMatch "\.php$">
3) Comment that entry (add the hash mark before it).
4) Add the following entry below it: <FilesMatch "\.(php|html|htm)$">
5) Save the file, and restart XAMPP and Apache.
The resulting change will look like this:
# bookmark1 (I add this before any change I make so I find changes easily)
# <FilesMatch "\.php$">
<FilesMatch "\.(php|html|htm)$">
Now, my Apache installation recognizes PHP code inside of my HTML files, and passes the PHP code to the PHP interpreter.
I am in no way an expert, but am just now learning how to do this, so I probably will not be able to answer any questions about PHP, Apache, or XAMPP.
However, I will ask the 'why' question, so maybe a real expert can answer it for me. Why is this a "bad" idea? A detailed explanation, please. Or, better yet, point me somewhere that I can read an explanation.
Mainly I am using PHP to call an external file as a menu. Is there a better way of doing this? I am helping support a church website and wanted to make it easy for them to maintain. This method will make it easy for them to modify one file, the external menu file, in order to change the menu on every page on their website. Plus they can delete and add pages without too much difficulty.
.