Problems with Server Side Includes (SSI)
1. SSIs don't work for VirtualHosts and/or user home directories.
This almost always happens because you don't have Options Includes set correctly in your httpd.conf. The issue is that it only applies where you set it and no where else. Each virtual host needs it's own Options Includes statement for this to work.
You will also need to ensure that the .shtml file extension is set up
with AddType and if you plan to implement an index.shtml you will need
to make sure that the DirectoryIndex for index.shtml is enabled if you plan to use pure SSI and .phtml should be enabled if you plan to use php/fi like this:
DirectoryIndex index.html index.htm index.cgi index.shtml index.phtml
The SSI include directive looks like this:
<!--include file="file_name"-->
2. What other ways are there to do includes?
One of the neatest ways is to use php/fi which has a very simple
include directive. It looks like this when coded for an html page:
<?include("top.php")>
In this example the file "top.php" contains the html code you want inserted at that exact location.
Be sure to enable the php_module and mod_php.c in conf/httpd.conf. Like this:
Uncomment the following line:
#LoadModule php_module modules/mod_php.so
and this line as well:
#AddModule mod_php.c
Note: to uncomment means to remove the "#" sign.
3. How can I use ErrorDocument and SSI to simplify customized error messages?
To answer this we have gathered up the relevant section of the Apache-FAQ and it makes this whole muddy issue crystal clear. Have a look at this: