Knowledge Base Article

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



Rating

Please indicate if this article was helpful for you.

rating :  4.3 from 5
views :  594
votes :  6

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!