Forum Moderators: phranque
I'm running the latest Apache in WinXP Home with MySQL, PHP and Perl. I'm using SSI (not by choice, in case you're wondering) for the header and footer of the pages of a website I'm building, and I'd rather not use the .shtml file extension. The problem is when using .htm, the header and footer does not show up when I preview the pages. They show up just fine if I use .shtml, but not .htm.
Please bear with me as I describe what I've tried already. In the Apache config file I have the following:
-----
Options Indexes FollowSymLinks ExecCGI Includes AddType text/html .shtml .htm
AddOutputFilter INCLUDES .shtml .htm Anytime I made the changes to the config file, I restarted Apache. But these changes did not work. So I tried making an .htaccess file with the following:
-----
AddType text/html .shtml .htm
AddHandler server-parsed .shtml .htm
Options Indexes FollowSymLinks Includes That did not work, either, so I even tried adding a line to that code, and taking the .htm off the other lines:
-----
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes All files are their correct directories and all that. Like I said, it works fine with .shtml but not .htm.
What am I missing? :(
Welcome to WebmasterWorld!
I have a question, too:
> The problem is when using .htm, the header and footer does not show up when I preview the pages. They show up just fine if I use .shtml, but not .htm
What specifically do you mean by the word "preview" above. I'm asking because you must request the page from the server in order for SSI to be processed, so I want to make sure we're not talking about the SSI not being visible in an HTML editor (which would be normal). Also, an old copy of the page might be cached by your browsert, so you'll need to flush your cache after any change to the page source or to the server config.
Jim
[edited by: jdMorgan at 12:23 am (utc) on Dec. 1, 2004]
Also, when I upload the pages to the company's web server, the .htm extension works, but not on localhost. This has me stumped. :(
[webmasterworld.com...]
AddType text/htm .shtml .htm
AddHandler server-parsed .shtml .htm
AddOutputFilter INCLUDES .shtml .htm
Note the difference between that and the other ones I tried (one of which I totally forgot to add .htm
to the string :o )...
No good:
AddType text/html .shtml .htm
AddOutputFilter INCLUDES .shtml .htm
No good:
AddType text/html .shtml .htm
AddHandler server-parsed .shtml .htm
No good:
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
GOOD! :) :)
AddType text/htm .shtml .htm
AddHandler server-parsed .shtml .htm
AddOutputFilter INCLUDES .shtml .htm
Thanks for the replies, even though they were questions to my question. ;)
Yup. The only thing bugging me was that .htm did not work when everything else did. My above post explains why. It's amazing how simple things can shoot right over my head sometimes.
text/htmas opposed to
text/html, that would explain why it wasn't working.
AddType text/htm .shtml .htm
#AddHandler server-parsed .shtml .htm
AddOutputFilter INCLUDES .shtml .htm