简体   繁体   English

SSI为什么不为我工作?

[英]Why don't SSI's work for me?

I'm trying to include one html file into another. 我正在尝试将一个html文件包含到另一个文件中。 I'm coding on the MAMP stack. 我在MAMP堆栈上编码。 I assume SSI's are automatically permitted. 我假设自动允许使用SSI。 I type <!--#include virtual="header.html" --> in the body of one html file, the other file is called header.html, and they are both in the same folder. 我在一个html文件的正文中键入<!--#include virtual="header.html" --> ,另一个文件名为header.html,它们都位于同一文件夹中。 I even tried calling the file header.shtml instead. 我什至尝试调用文件header.shtml代替。 None of this works. 这些都不起作用。 It's frustrating. 真令人沮丧

The code isn't included. 该代码不包括在内。 I'm including a form and a navigation bar, but they don't appear. 我包括一个表单和一个导航栏,但它们没有出现。

I assume SSI's are automatically permitted 我假设自动允许SSI

That's a very big assumption. 这是一个很大的假设。 SSIs will only work if you've got mod_include loaded. 只有加载了mod_include后,SSI才起作用。 You also need to enable the filter for the relevant files, eg 您还需要为相关文件启用过滤器,例如

AddOutputFilter INCLUDES .shtml

...and of course ensure that Includes are not overridden elsewhere in the config. ...并且当然要确保在配置的其他位置不覆盖Includes。

Did you read this ? 你读过这个吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM