6

In IIS 7.5, is it possible to use web.config alone to enable SSI processing for files that have the .html extension? Specifically, I don't want to use the default SSI extension, .shtml.

Reason: I don't want to change the extensions. Doing so would lead to broken links in search engine results.

Also, my motivation for doing this in web.config is because this is a shared server.

DavidRR
  • 18,291
  • 25
  • 109
  • 191
Trojan
  • 2,256
  • 28
  • 40
  • Related: [Configuring IIS 7.5 to enable server side includes (SSI) for the '.html' extension](http://stackoverflow.com/q/14135582/1497596) – DavidRR Aug 20 '14 at 13:02

1 Answers1

7

Presuming that your hoster has enabled SSI's and delegated Read/Write permissions for handler mappings then this should work:

<configuration>
    <system.webServer>
        <handlers>
            <add name="SSINC-html" 
                 path="*.html" 
                 verb="*" 
                 modules="ServerSideIncludeModule" 
                 resourceType="File" 
                 requireAccess="Script" />
        </handlers>
    </system.webServer>
</configuration>

Whilst we're on the topic, Robert McMurray (MSFT IIS staffer) has a fairly recent refresher blog post all about SSI's here:

http://blogs.iis.net/robert_mcmurray/archive/2010/12/28/iis-notes-on-server-side-includes-ssi-syntax-kb-203064-revisited.aspx

Kev
  • 118,037
  • 53
  • 300
  • 385
  • Great link! I'd been looking for something like that blog post. – Trojan Jul 17 '13 at 15:30
  • 2
    An [alternative link on MSDN](http://blogs.msdn.com/b/robert_mcmurray/archive/2010/12/28/iis-notes-on-server-side-includes-ssi-syntax-kb-203064-revisited.aspx) to the same article. – DavidRR Aug 20 '14 at 12:57