What is SSI and how to activate it

What is SSI and how to activate it

SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology (for example, PHP).
The decision of when to use SSI, and when to have your page entirely generated by some program, is usually a matter of how much of the page is static, and how much needs to be recalculated every time the page is served. SSI is a great way to add small pieces of information, such as the current time. But if most of your page is being generated at the time that it is served, you need to look for some other solution.

You can enable SSI for any of your websites. To do so, go to the File Manager section of your Hosting Control Panel and create an empty file called .htaccess in the home directory of your domain (for my-best-domain.com, the directory would be usually /www/my-best-domain.com/)

Next, edit the .htaccess file with a plain text editor and add the following code:

AddType text/html .shtml
AddHandler server-parsed .shtml
DirectoryIndex index.shtml index.html index.htm index.php

You are allowed to include static files using SSI, for example, you can add the following includes in your index.shtml:

<!--#include virtual="included.html" -->
or
<!--#include virtual="included.txt" -->

However, the use of the Exec command will fail, for example:

<!--#exec cgi="../hitcounter.php" -->

will display error [an error occurred while processing this directive].

To show the local date and time, you can add the following line:
<!--#echo var="DATE_LOCAL"-->

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Where do I find .htaccess file?

Inside public_html folder. You need to login via FTP or cPanel > File manager (make sure you...

Catch-all email (catch-all alias)

We removed catch-all accounts on all shared servers to prevent further spam attacks / disk...

How do I register or change my Name Servers?

The process of setting up a name server requires that you contact the specific registrar where...

The Database(s)

The Database(s) Only some websites have a database, so if your website doesn't then skip over to...

What is class C IP?

An IP consist of 4 parts: AAA.BBB.CCC.DDD. So any IP under the last part will be in the same...

Powered by WHMCompleteSolution