Configuring IIS 7.5 to enable server side includes (SSI) for the '.html' extension

前端 未结 2 2089
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 15:55

I want to configure Server Side Includes (SSI) in IIS 7.5. By default, the file extension that indicates that a file should be processed as an SSI file is

2条回答
  •  半阙折子戏
    2021-02-09 16:40

    You can try something likes below.

    CONFIGURATION SAMPLE

    The following configuration sample disables the #exec command for SSI files in the Default Web Site.

    
       
          
       
    
    

    C# file looks like below

    using System;
    using System.Text;
    using Microsoft.Web.Administration;
    
    internal static class Sample
    {
       private static void Main()
       {
          using (ServerManager serverManager = new ServerManager())
          {
             Configuration config = serverManager.GetApplicationHostConfiguration();
    
             ConfigurationSection serverSideIncludeSection = config.GetSection("system.webServer/serverSideInclude", "Default Web Site");
             serverSideIncludeSection["ssiExecDisable"] = true;
    
             serverManager.CommitChanges();
          }
       }
    }
    

    You can get more information Server Side Include

    For your 2nd Question:

    You can use Master page.Then all inherited pages will have both headers and Footers.

    I hope this will help to you.

提交回复
热议问题