JCam
JCam

Reputation: 614

Allow SSI include directive for all HTML pages in htdocs folder using MAMP

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] 

Upvotes: 2

Views: 5019

Answers (2)

3point14
3point14

Reputation: 29

I find the most common reason that SSI still fails following these set up procedures is that that the port (default 8888) is not specified when calling the local web page in the browser.

See: http://documentation.mamp.info/en/mamp/first-steps

Upvotes: 2

JCam
JCam

Reputation: 614

It turns out that that using virtual rather than file works on sub directories. I'm still not sure if there is any particular reason file doesn't work. The question was answered on serverfault.com.

The thread is available here: https://serverfault.com/questions/214096/how-to-enable-ssi-for-all-html-files

Upvotes: 1

Related Questions