为什么 SSI 不适合我?
我正在尝试将一个 html 文件包含到另一个文件中。我正在 MAMP 堆栈上编码。我认为 SSI 是自动允许的。我输入 在一个 html 文件的正文中,另一个文件称为 header.html,并且它们都位于同一文件夹中。我什至尝试调用文件 header.shtml 。这些都不起作用。真令人沮丧。
该代码不包括在内。我添加了表单和导航栏,但它们没有出现。
I'm trying to include one html file into another. I'm coding on the MAMP stack. I assume SSI's are automatically permitted. 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. I even tried calling the file header.shtml instead. 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个非常大的假设。仅当您加载了 mod_include 时,SSI 才会起作用。您还需要为相关文件启用过滤器,例如
......当然还要确保 Includes 不会在配置中的其他地方被覆盖。
您读过此内容吗?
That's a very big assumption. SSIs will only work if you've got mod_include loaded. You also need to enable the filter for the relevant files, e.g.
...and of course ensure that Includes are not overridden elsewhere in the config.
Did you read this?