What Is SSI?

What Is SSI

Date First Published: 29th November 2022

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Advanced

Difficulty Level: 8/10

CONTENTS

Learn more about what SSI is in this article.

Stands for Server-Side Includes. SSI is a World Wide Web scripting language used to include Apache executable instructions that are run by a web server, allowing dynamically generated content to be added to an existing HTML page. An example of an SSI instruction can be seen below:

<!--#echo var="DATE_LOCAL" -->

If SSI is properly enabled, the web server should return the correct date and time.

In order for a web server to recognise an SSI-enabled file and carry out the instructions, the filename should end with a special file extension, such as '.shtml', '.stm', and '.shtm'. It is important to note that files do not have to be renamed to '.shtml' for SSI to be supported. The xBitHack option can also be used in the .htaccess file which instructs Apache to parse files for SSI directives if they have the executive bit set.

Using the xBitHack option requires Apache to read through every single file on the web server even if they don’t contain any SSI directives, slowing things down a bit. This will tell Apache to parse all ‘.html’ files for ‘.shtml’ so that website owners don’t have to rename files to this every time they want to include SSI within a page.

Directives

SSI has simple directive syntax: <!--#directive parameter=value parameter=value -->. The main reason why directives are placed in HTML comments is that if SSI is disabled, users will not see the SSI directives on the webpage unless they view the source code.

Note: Info Icon

The Apache tutorial on SSI specifies that the format requires a space before the closing "-->".


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.