Search code examples
htmlssishtml

I can't get header to appear using SSI with html


So I'm working with SSI to implement global items like headers, and footers etc. basically for server side scripting since I am using a simple web host.

Now I've checked with the company and SSI is enabled by default. I even ran a few SSI tests which all came back positive to prove my point.

I built a header.html file to be imported into my different pages. The header.html goes a little something like this:

<div class="navbar-wrapper">
    <div class="container">
        <div class="navbar navbar-inverse navbar-static-top" role="navigation">
            <div class="container">
                <div class="navigation-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">Skyline Interactive</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li><a href="#">Home</a>
                        </li>
                        <li><a href="http://skylineinteractive.org/web/views/about/about.html">About</a>
                        </li>
                        <li><a href="#contact">Contact</a>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Games <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="/SoG">State of Gray</a>
                                </li>
                                <li><a href="/Alder">Aldervinia</a>
                                </li>
                                <li class="divider"></li>
                                <li class="dropdown-header">Other</li>
                                <li><a href="/skyblog">SkyBlog</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

I am using the SSI include in my html page like below. For example, in home.html (and yes I have a handler that also parses .html and .htm -- I tested these files as well for SSI and they passed):

 <!-- #include virtual="/web/includes/header.html" -->

I have this at the very top of my body tag. Am I just missing something? Or are there any ideas where I could have messed something up?


Solution

  • Yeah. I think the issue is that you have to get rid of the space just before the # so that it becomes:

    <!--#include virtual="/web/includes/header.html" -->