IIS 10.0 on Windows 10 - beginner needs enable "server side includes" (simple) [Answered]RSS

2 replies

Last post Nov 16, 2019 06:31 PM by wb0gaz

  • IIS 10.0 on Windows 10 - beginner needs enable "server side includes" (simple)

    Nov 12, 2019 03:12 PM|wb0gaz|LINK

    I am a beginner using IIS 10.0 on Windows 10 to serve a simple set of HTML pages to local (127.0.0.1) user. There are no add-ons and no changes to IIS 10.0 configuration (except to set up binding for my set of web pages). This is working well.

    I need to use "server side includes" so I can consolidate redundant content among a set of HTML pages.

    QUESTION 1: What are the steps needed to enable this capability in the environment I am using?

    My attempt so far (which is not successful - the include files instructions which look like HTML comments are ignored) entailed adding server side includes (via control panel -> programs and features -> turn windows features on or off -> iis -> www services -> application development features -> server-side includes). I also added (in the same pane) ASP and ISAPI extensions (for no good reason except that was suggested via my prior searching before landing here.)

    QUESTION 2: Can my html files remain extension .html, or must they change to .asp or something else? If I am compelled to change to .asp, is there any other change needed to my .html file content (which is very basic - no scripting, no embedded applications, just straight HTML and CSS.)?

    Thank you!

  • Re: IIS 10.0 on Windows 10 - beginner needs enable "server side includes" (simple)

    Nov 13, 2019 08:51 AM|Jalpa Panchal|LINK

    Hi,

    wb0gaz

    QUESTION 1: What are the steps needed to enable this capability in the environment I am using?

    Server Side Includes (SSI) is an optional feature of the web servers helping the developers to include HTML file content from a base file into multiple other HTML files with a single line of code.

    to configure SSI in iis you could follow the below steps:

    1)enable SSI feature in iis.

    open control panel->Programs and Features' > 'Turn Windows features on or off'. Find the IIS group and check 'CGI' and 'Server-Side Includes'.

    2)To enable SSI for the .htm and .html files open 'IIS Manager', select your site, and open 'Handler Mappings' feature and create module mapping entries for .htm and .html, optionally restricting availability for only 'File or folder' requests:

    3)create file e.g menu.ssi

    <ul class="menu">
        <li><a id="miHome" href="Default.html"> Home</a></li>
        <li><a id="miPage1" href="page1.html"> Page 1</a></li>
        <li><a id="miPage2" href="page2.html"> Page 2</a></li>
        <li><a id="miPage3" href="page3.html"> Page 3</a></li>
    </ul>
    

    Call the .ssi content from within your other HTML files using one of the following options, depending on how your menu.ssi file is deployed on the server:

    <body>
      <!-- ... -->
      
      <!--#include virtual="/includes/menu.ssi" -->
      <!-- or -->
      <!--#include file="menu.ssi" -->
    
      <!-- ... -->
    </body>

    wb0gaz

    QUESTION 2: Can my html files remain extension .html, or must they change to .asp or something else? I

    in my opinion your extension will not change.

    you could refer some below link for more detail:

    IIS Server-Side Include Directives

    IIS: Notes on Server-Side Includes (SSI) Syntax (KB 203064 Revisited)

    https://stackoverflow.com/questions/17688185/use-web-config-to-allow-server-side-includes-in-html-files-iis

    https://stackoverflow.com/questions/14135582/configuring-iis-7-5-to-enable-server-side-includes-ssi-for-the-html-extensi

    https://www.elvenware.com/server-guide/ServerSideIncludes.html

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: IIS 10.0 on Windows 10 - beginner needs enable "server side includes" (simple)

    Nov 16, 2019 06:31 PM|wb0gaz|LINK

    Hello Jalpa,

    Thank you for the detailed reply.

    I have success!

    Adding html to handler mappings took a few try because I have not encountered this system before, but I was able succeed add *.html/SSINC-html/enabled to the list in handler mappings, restart IIS 10.0, then on next try my simple HTML test file worked.

    Also, for windows features I only have selected CGI and Server Side Includes, all other boxes not checked.

    THANK YOU VERY MUCH FOR YOUR KIND AND DETAILED SUPPORT!