Use web.config to have the server side include HTML (IIS) files

In IIS 7.5, you can only use web.config to enable SSI processing of files with the extension .html ? In particular, I do not want to use the default SSI extension, .shtml .

Reason: I do not want to change the extensions. This will break the links in the search results.

Also, my motivation for this in web.config is that it is a shared server .

+6
source share
1 answer

Assuming your host server has enabled SSI 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> 

While we are on this subject, Robert McMurray (MSFT IIS staffer) has a fairly recent updated blog about SSI here:

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

+7
source

Source: https://habr.com/ru/post/949611/


All Articles