Why my Apache Server Side Include (SSI) is not working?
Q. I would like to use Server Side Include (SSI) from my html pages. But it is not working for VirtualHost. How do I configure Apache Server Side Include?
A. 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 or httpd.conf file:
vi /etc/httpd/httpd.conf
OR
vi .htaccess
Add following directive:
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:
$ vi test.shtml
Append any one of the following SSI directive:
<!--#echo var="DATE_LOCAL" -->
OR
<!--include file="counter.cgi"-->
Save the file. Restart Apache and test your configuration.
For more information see Apache SSI tutorial
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- How to include files with PHP
- Howto rebuild Apache for Cpanel Linux / UNIX Server (Control Panel)
- My scripts in cgi-bin directory not working, how do I troubleshoot this problem?
- PHP Linux installation or php upgrade howto
- Ubuntu Linux install or add php gd support to Apache
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


Recent Comments
Today ~ 5 Comments
Today ~ 10 Comments
Today ~ 1 Comment
Today ~ 3 Comments
Today ~ 57 Comments