Skip to content Skip to sidebar Skip to footer

Configuring Iis 7.5 To Enable Server Side Includes (ssi) For The '.html' Extension

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 .shtml. However, I want t

Solution 1:

Hey got the answer just needed to surf some more Here is the link where you can configure IIS server to use Server side include for .html pages as its default provided for .shtml but I didnt wanted that. this link is very helpful

http://tech.mikeal.com/blog1.php/server-side-includes-for-html-in-iis7

Solution 2:

You can try something likes below.

CONFIGURATION SAMPLE

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

<locationpath="Default Web Site"><system.webServer><serverSideIncludessiExecDisable="true" /></system.webServer></location>

C# file looks like below

using System;
using System.Text;
using Microsoft.Web.Administration;

internalstaticclassSample
{
   privatestaticvoidMain()
   {
      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.

Post a Comment for "Configuring Iis 7.5 To Enable Server Side Includes (ssi) For The '.html' Extension"