Server Side Includes (SSI)

Covers what is required to use Server Side Includes in your account, some sample SSI code, and troubleshooting assistance.

 

What are Server Side Includes?


Using SSIs


Sample Code


Troubleshooting Tips

 

 

 

What are Server Side Includes?

 

Server Side Includes, also known as SSIs, are a tool that can be used to simplify management of your website. They allow you to include the contents of one file into another file. For example, if you have a header on all of your pages that you need to change, you have to edit each page individually. However if you are using SSIs, and including the same header file onto each page, you only have to make one edit to that header file, and the change will instantly take place across your entire website.

 

 

 

Using SSI's

 

The only thing you need to do to use SSIs is name your files with the .shtml file extension. For example if you had the file:

 

sample_page.html

 

That you wanted to use SSIs on, you would put your include tags into the HTML and save the file as:

 

sample_page.shtml

 

and upload it to your account, along with any files it is "including". Barring any SSI code errors, everything will work properly.

 

 

 

Sample Code

 

The most common SSI tag is the "virtual" include. It is the most flexible of the include tags, and can understand a variety of include items. To use it, put the following code in your document where you want the remote file to be included from:

 

 <!--#include virtual="file_to_be_included.html" -->

 

If you would like to do more with SSIs than include files, or if you have a special SSI need, please see read the complete SSI specification: http://www.apache.org/docs/mod/mod_include.html

 

 

 

TroubleShooting SSIs

 

Because SSIs are fairly straight forward, the room for error is typically fairly small. the most common problems, and their common fixes, are:

 

The include does not work, and there is no error message -  Make sure that you are using the .shtml extension on your file. If you are not using the .shtml extension, the server won't know to look for any SSI code.

 

[an error occurred while processing this directive] - This error is generated when there is a problem with the SSI code. The 2 most common culprits are:

 

1) The file you are including has not been uploaded.

 

2) The path/filename for the included file is incorrect.

 

 

Please let us know if you have any questions!

Was this answer helpful?

 Print this Article

Also Read

PHP

Details on our PHP installations, as well as links to PHP resources.   What is PHP? PHP File...

Using Perl

Details for running Perl scripts on our shared servers.   Installing Scripts CGI Folder...

Using the .htaccess File

A breif tutorial on how to use the .htaccess file to set up custom (404) error pages, redirect...