Server Side Includes

Posted on 2004-11-16
Last Modified: 2013-11-18
I am a  'newbie' (very). I am a 77 year old man with a WebSite. I have been reading about 'Server Side Includes' and I like what they can do and I want to use them. I am at a complete loss as where to start, how find them, how to install/setup/configure them etc. I just joined EE to try to find the answers. I need someone to start at the VERY begining and walk me through the process. I  understand most of the FTP and uploaning files to the server. I have been to most of the sites on the web but they don't give me what I need. All the help you can give me will be greatly appreciated. Regards: willinreno
Question by:willnreno
    LVL 15

    Accepted Solution

    Server Side Includes (SSI) are a feature of the Apache web server software.  You need to make certain that your web site is hosted on a server that uses Apache, and that SSI is enabled.  To find out if you are using Apache, you can put your URL into the form entitled "What's that Site running?" at - it will tell you if you are using Apache or a different software.  Your web host can tell you if SSI is enabled, or you can test it on a test file.

    SSI can be used for several things, but are most commonly used to include either:

    (1) another file that contains an HTML fragment that is used in many pages (such as a header, footer, or navigations) so that you only have to update one page

    (2) the output of a CGI script so that the page content can change day to day (like a script that says what today's date is).

    There are also other commands that can be used to print out things like the last time that the file was modified.

    As SSI requires that the web server do extra work to 'parse' the file (i.e. read and interpret it) instead of just sending the contents of the file to the site user's browser, many hosting companies distinguish between pages which use SSI and which do not by requiring that HTML files that use SSI have a special file extension, usually .shtml or .shtm (instead of .html or .htm).

    The basics of (1) are very simple;  to include the contents of another file into your html file, you can use:

    <!--#include virtual="/path/to/file"-->

    For example, if I had the following simple fragment:

    <small>Copyright 2004 Will N  Reno</small>

    in a file called copyright.html in the uppermost directory of my web site, I could include it from another file (perhaps called test.shtml) as follows:

    <title>My Title</title>
    <h1>My Test</h1>
    <p>Some text</p>
    <!--#include virtual="/copyright.html"-->

    There are some good references that have been written on SSI:

    ... and if you have more questions, ask away!


    Author Comment

    Thanks..Periwinkle I think this will do the trick. I had sent an e-mail to my hosting company but didn't get an answer, until now. It says that their servers are SSI enabled,  so I may be able to do it. I have plenty of books but if I need more help I will come to you...again, Thanks  willnreno

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    How to analyze web traffic logs 10 77
    XAMPP 14 33
    apache and php 3 80
    Ubuntu 14 with Apache 7 64
    Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now