Use Server Side Includes

Server Side Includes (SSI) are codes you can add to your HTML document that tell the web server to include other content with the document being served. For example, you can use an #include statement to display the same header and footer on your pages automatically; if the information changes, you can save time by editing a single header.html or footer.html file. You can also use SSI for graphics such as logos or image maps that should appear on multiple pages.

On Webserve accounts, pages that use SSI (#include statements) need the .shtml extension. Included files can have other extensions (for example, .html).

Webserve is scheduled for retirement on December 23, 2019, and will be replaced by IU Sitehosting. All sites hosted on Webserve must be migrated to IU Sitehosting by that date or content will be inaccessible.
The #exec command is often used to run a CGI or Perl program from a web page; for security reasons, the #exec SSI is not enabled on Webserve.

Use SSI with files in the same directory

In SSI, the #include statement tells the server to include another file:

<!--#include file="filename.html"-->

You can use SSI to display banner and header information, as in the following example:

<!--#include file="header.html" -->

In the above example, the #include statement appears in the body of the document, immediately after the <body> tag. In SSI, the process of including takes two separate files and creates one whole file. The server takes the SSI page and inserts it into the page calling it.

Use SSI with files located in different directories

If the SSI calls a file that is located in another directory in the account, use #include virtual instead of #include file. For example:

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

In the above example, the header.html file is located in the directory above the location of the file referencing it.


The footer for this page is created dynamically, so that the date that the file was last modified automatically appears in the footer. The server side include statement calls another .shtml file, using this code:

<!--#include file="footer.shtml" -->

The footer statement on this page is placed at the bottom of the file, just before the </BODY> tag.

For more about using SSI on Webserve, see Server Side Includes tutorial.

This is document bfsa in the Knowledge Base.
Last modified on 2019-08-09 13:19:56.

Contact us

For help or to comment, email the UITS Support Center.