Search code examples
htmlssi

Using SSI (Server Side Includes)


I'm trying to learn how to do Server Side Includes because I need them for a project of mine. Now, can I use SSI locally? My site is 100% HTML, Javascript, and CSS, so there is no server running my stuff. I'm just editing the files in notepad. What can I do to allow me to work on SSI before I upload it to the server that I plan on sending it to.


Solution

  • What can I do to allow me to work on SSI before I upload it to the server...?

    If you're not running a server, then you can't use server-side includes. The clue is in the name. So if you're testing the page locally without a server, then your SSIs won't work.

    The only way you're going to be able to do this is to install a web server on your local PC.

    Fortunately this is fairly easy. The two major web servers are Apache and IIS. Apache is free; you can download it and install it for free. IIS is a commercial product (by Microsoft), but there is a cut-down version you can install for free. Pick whichever one is best for you (ie the one which matches your actual web server), and you should be able to get your SSI code working. You'll probably need to do some config to set it up, but as a web developer that's a good thing to know how to do.