How to use Server Side Includes (SSI) in your pages

By default, if you want to use Server Side Includes in your files, they have to be with .shtml or .shtm extension. Alternatively, you can add the following line to your .htaccess in order to specify different file types that should be checked for such includes:

AddHandler server-parsed .extension

You can then add code to your pages that will be processed by the web server. This code should be in the following format:

<!--#'<tag><variable set> '-->

Below, you can find a brief explanation on how Server Side inclusions are structured and how they work.

<!--#" is the opening identifier, each Server Side inclusion should start with those symbols.

<tag> specifies the command that you can to send to the server. This can be: echo, include, fsize, flastmod, exec, config , odbc, email, if, goto, label, break.

<variable set> is a set of variables and their values. They should be added depending on the used tag.

--> is the closing tag. All of your SSI code should end with it.

Here is an example of how to include a PHP file into an existing page using SSI:

<!--#include virtual="/another-file.php" -->

You can find a detailed explanation on all the advantages that Server Side Includes has at the following address:

http://http-server.carleton.ca/~dmcfet/html/ssi.html

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Brute Force Attack – What it is and How to Block It

Brute-force is a method of guessing your password by trying combinations of letters, numbers and...

What is pdftoppm and is it supported by Hostlantern?

Pdftoppm is a library that handles the conversion from Portable Document Format (PDF) files to...

How to clear your Internet browser’s cookies?

Sometimes you may need to clear the cookies saved by your browser. Basically the cookies...

Hacked Website

The most common reasons for a hacked (defaced) website include: - Outdated web application....

How to clean my files from malicious code?

If your website has been hacked and malicious content has been inserted into your files, you...