Enabling Server Side Includes (SSI) in Apache Web Server

22. July 2013

Enabling Server Side Includes (SSI) in Apache Web Server

You can go on this link to find the apache documentation for the same .

If you have any confusion in the apache documentation then you can follow the below steps with which i was able to enable SSI in Windows environment using WAMP 

1. First open the httpd.conf file of apache

2. Find the directory you want to enable SSI for

3. Include statement "Includes" in "Options" Directive of the directory you want SSI in, check below image for reference.

 

4. Not just any file is parsed for SSI directives. You have to tell Apache which files should be parsed. You can tell Apache to parse any file with a particular file extension, such as .shtml, with the following directives:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Check the below image where you have to add above code :

5. We are done with configuration , now restart the apache web server and from now onwards use extension .shtml to all the files you want to have SSI code .

6 Now you can try accessing your index.shtml in web browser and it will run all the SSI codes . Thanks !

Apache ,