What does SSI (Server Side Includes) mean?

SSI or Server Side Includes are used to add contents of other files or variables from the server directly into html web pages.

To use this function your web pages must use the suffix ".shtml" rather than ".html" or ".htm", i.e. index.shtml not index.html.

Server Side Includes are particularly useful for including a common piece of code throughout a site, such as a page header or a page footer.

For example, certain web pages could have copyright information included in them by placing the following code into the web pages:

<!--#include virtual="../copyright.txt" -->

When any changes are made to the copyright.txt file, all pages that include the code will display the updated information.

Server Side Includes may also be used to display system variables such as the current time. Some common SSI codes are:

<!--#echo var="HTTP_REFERER" -->  (displays referring URL)

<!--#echo var="REMOTE_ADDR" -->  (displays visitor's IP address)

<!--#echo var="REQUEST_URI" -->  (displays requested URL)

<!--#echo var="HTTP_HOST" -->  (displays server name)

<!--#echo var="HTTP_USER_AGENT" -->  (displays visitor's browser)

<!--#echo var="REDIRECT_STATUS" -->  (displays redirect status code)

<!--#echo var="DATE_LOCAL" -->  (displays visitor's date and time)

<!--#include virtual="path/file.ext" -->  (includes the specified file)

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

htaccess code examples

Your .htaccess file is commonly used to change the way that people access or view your site. This...

How to run php code in an html page?

If you want to run php code in your html web pages we recommend that you rename them using the...

What is a shtml file type?

A web file type with the suffix of ".shtml" (rather than the usual ".html" or ".htm") indicates...

Internal Server Error - http 500 error

Internal server errors can be caused by a few different things. Please check the Error Logs in...

Bandwidth Limit Exceeded - http 509 error message

If you are seeing the following http 509 Bandwidth Limit Exceeded error it is because you have...

Powered by WHMCompleteSolution