开发者

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 开发者_Go百科get this error:

[an error occurred while processing this directive] 


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜