How can I use ssi on files with .html extensions?

October 30, 2012     0 comments

Our servers are configured by default to only parse files with a .shtml extension with server-side includes. If you make sure all your files that include other files (using SSI) are named "file.shtml" you won't have to do anything to get them to work!

We realise that some people however have transferred a site from a different server configuration where any .html file was parsed for SSI. It can be a big pain to rename all the files in a website, as well as fix any links between them. Because of this, we allow users to turn on parsing of ANY sort of file they'd like.

Simply create a plain text file named ".htaccess" in the directory in which you'd like all files with a different extension to be parsed for SSI.

Inside the .htaccess file, put this one line:

AddHandler server-parsed .html .htm
That's it! Now any file ending in .html or .htm will have SII run on it! We really don't recommend doing this unless absolutely necessary. It adds some overhead to the web serving to parse in SSI, and so each and every request for a .html / .htm file (even ones that don't have any SSI in them) will be a little bit slower when you turn on this option. It's much better to just name the appropriate files with the .shtml extension if you can!

How helpful was this article to you?

FraudLabs Pro Secured Seal