Forum Moderators: phranque
Just add this line to the existing .htaccess file, or create a plain text file with this line in it:
AddHandler server-parsed .html .htm .shtml
That will tell your server to treat .html and .htm pages the same as .shtml pages, and you can use SSI on any page, without worrying about changing your suffixes!
(Test it to make sure your host has given you the ability to use the AddHandler function at your account level...)
However, on those pages where *all* you include is headers and footers - basically pages with no real dynamic content - you might want to use the XBitHack Ffull option as well. This will cause the html page to "keep" it's own Last-Modified date and send it in the http response header. Otherwise it gets dropped, because Apache can't otherwise be sure which Last-Modified date to return; that of the html page or that of one of the included files.
You do NOT want to use this mechanism on your pages with truly-dynamic content, though.
It's explained better in the Apache mod_include documentation. :)
Jim
and it's located in my htdocs folder. It's working right now. I need it to work for my index page... and I don't need it to work for any other page on my server.
It's just used to bring in one image to the index page of my site. I couldn't care less about the rest of my pages. The rest of my site (almost every page) is dynmaic (.php).
Thanks for all of the great advice. Should I just keep the addhandler code on that .htaccess file in my htdocs folder and then upload blank htdocs files to the rest of the my directories (the ones that contain my php scripts etc.)?
Any help would be greatly appreciated. Thanks!
Options +Includes
XBitHack on
You just change the permissions chmod to 755 for these pages and then the .htm
pages with chmod chaged to 755 are parsed as if they are .shtml pages.
The cool thing about this is that it ONLY parses those pages that you want.
You should not include the AddHandler server-parsed .html .htm .shtml
code if you are using the xbithack code. The xbithack code alone does the trick.
Thanks for all your help. Does anyone know of any security issues using the xbithack. I don't think there are, but I wanted to check and make sure.