Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

Server Side Includes

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
1 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 http://www.netcraft.com - 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!

willnrenoAuthor Commented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now