How do I enable SSI (Server Side Includes)?

 October 3, 2010     0 Comments

From Aapache site, "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".

Make sure you have following configuration directive/line in your .htaccess file, add following directive into it:

Options +Includes

(Above directive (Options +Includes) tells Apache that you want to permit files to be parsed for SSI directives)

Next, make sure Apache knows which files should be parsed using SSI.

AddType text/html .shtml
AddHandler server-parsed .shtml

Now test your configuration by adding any one of the following SSI directive

Make a test.shtml file and add any of the following:

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


<!--include file="counter.cgi"-->

Save the file.

How helpful was this article to you?

Powered by

FraudLabs Pro Secured Seal