1and1 Help Centre Categories

print article

What are SSI (Server Side Includes)?

Server Side Include is a type of HTML comment that directs the web server to dynamically generated data.

It applied to an HTML document, provide for interactive real-time features such as echoing current time, conditional execution based on logical comparisons (if, else if, else), executing CGIs, etc.

Server Side Include tags can be added to a page where ever dynamic data is required and the server will process the command(s) within the tag(s) before the page is sent to the viewer of the page. An SSI tag will follow the format below:

<!--#element attribute=value attribute=value ... -->
Please note:
Any page containing SSI tags must have the .shtml or .shtm extension.
Examples:

Including a header/footer:

<--#include file="footer.html" -->

Including output from a CGI:

<--#exec cgi="hitCounter.cgi" -->

Including output from a SHELL command:

<--#exec cmd="ls -la" -->

Output HTTP Environment Variables:

<--#echo var="HTTP_USER_AGENT" -->
For additional information, you may want to reference: