Web Analytics Made Easy -
StatCounter SSI - HTML Include, not all of them are working :( - CodingForum

Announcement

Collapse
No announcement yet.

SSI - HTML Include, not all of them are working :(

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SSI - HTML Include, not all of them are working :(

    Hey,

    I'm using SSI HTML Include a number of times within several HTML files, on Document everything works fine. But yet when i moved all the files to Document then not everything is working as you will see the logo and menu missing from the page. When i view the source code i can see the following meaning the server hasnt included the files:

    Code:
    <!--#include virtual="logo.html"-->
    					</div>
    					<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    						<!--#include virtual="menu.html"-->
    The above code is loaded from the following:

    Code:
    <!--#include virtual="template/header.html"-->
    So i know the SSI HTML Include works as it works for some but for some reason isnt working on loading the logo and menu.

    Everything should work straight away from moving the files from /rainbow to the main directory but for some reason its not. Does anyone know why?

    Thanks in advance!

    PS: I've tried changing to path to template/menu.html and template/logo.html but still no joy.

  • #2
    For SSI to work the file names of the files containing them must end in .shtml

    you need to change header.html to header.shtml

    either that or you need to change server side settings so that all .html files get parsed for SSI
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

    Comment


    • #3
      Originally posted by felgall View Post
      For SSI to work the file names of the files containing them must end in .shtml

      you need to change header.html to header.shtml

      either that or you need to change server side settings so that all .html files get parsed for SSI
      But how come it works fine on /rainbow but not in the main directory?

      Comment


      • #4
        Perhaps you have a command in the .htaccess file on /rainbow that sets .html to parse for SSI.
        Stephen
        Learn Modern JavaScript - http://javascriptexample.net/
        Helping others to solve their computer problem at http://www.felgall.com/

        Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

        Comment


        • #5
          Originally posted by felgall View Post
          Perhaps you have a command in the .htaccess file on /rainbow that sets .html to parse for SSI.
          I've checked and theres no .htaccess file. Surely there must be something thats causing it not to work?

          Comment


          • #6
            If you put them all in the same directory with no paths, does it fly?

            If you change them all to .shtml as suggested, does it fly?

            I would think the .html extension would be enough to break it, but it could be a pathing issue as well, though... I'm not entirely sure you can run .shtml from inside .shtml -- strange as that sounds.

            SHTML is a kludge, and a ugly one at that. NO bytecode compilation, no result caching -- I would HIGHLY suggest switching to something like PHP instead of trying to deploy something that's Apache only (well, mostly) and has mostly gone the way of the dodo for over a decade.

            Of course, just those presentational classes and ID's alone are throwing up warning flags here... do I even want to see the full markup? No, no I don't... It's unlikely i'd have kind words.
            Walk the dark path, sleep with angels, call the past for help.
            https://cutcodedown.com
            https://medium.com/@deathshadow

            Comment

            Working...
            X