Use web.config to allow server-side includes in HTML files (IIS)

后端 未结 1 836
面向向阳花
面向向阳花 2021-01-05 15:51

In IIS 7.5, is it possible to use web.config alone to enable SSI processing for files that have the .html extension? Speci

相关标签:
1条回答
  • 2021-01-05 16:17

    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

    0 讨论(0)
提交回复
热议问题