How to enable SSI for all html files

apache-2.2httpd.confmampserver-side-includes

I use MAMP to develop sites. I have each site in it's own folder in the htdocs folder. I manage one site that I need to use ssi directives on, because the host doesn't allow php includes.

I've un-commented these lines in httpd.conf file:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

I added a .htaccess file in the htdocs folder with the following:

AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes

On the site index page the include works using:

<!--#include file="top-nav.shtml" -->

But it does not work on files in any sub folder. I get this error:

[an error occurred while processing this directive]

Best Answer

Are you using the exact same include directive on all the sub-folder pages, too? If so, your problem seems clear: You aren't linking to the include file properly (unless you have that same file in every single directory on the site, which would sort of defeat the purpose)

Other than that, I'd want to know; what is the error you are getting on the server? Why do you think that SSI is not 'enabled' - especially considering it is working on one file, at least.