wamp ssi 不工作

发布于 2024-12-26 03:49:40 字数 446 浏览 1 评论 0原文

我正在与 wamp 合作。我想使用 ssi,所以我更改了 httpd.conf 中的以下行,但它似乎不起作用:

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

test.html

<html>
<title>This is incl html</title>
<!--#include file="menu.shtml" -->
</html>

menu.shtml

<h1>hheelloo</h1>

我缺少什么?

i am working with wamp. i want to use ssi so i have changed following lines in httpd.conf but it does not seem to be working :

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

test.html

<html>
<title>This is incl html</title>
<!--#include file="menu.shtml" -->
</html>

menu.shtml

<h1>hheelloo</h1>

What am i missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

Saygoodbye 2025-01-02 03:49:40

将包含以下内容的 .htaccess 文件添加到项目根目录中。

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

这应该允许包含在该项目上工作。

Add to your projects root directory a .htaccess files with the following.

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

This should allow includes to work on that project.

め可乐爱微笑 2025-01-02 03:49:40

我遇到了同样的问题,直到找到此链接 -

http://www.roseindia.net/tutorial/php/phpbasics/Setting-Up-SSI-On-Wamp.html

答案的要点如下。似乎需要将这些行添加到文件中的特定位置。他们还建议寻找并解决问题。替换 FollowSymLinks 选项 -

How to add SSI (Serverside include support in WAMP)?
Open http.conf file from <your drive):\wamp\bin\apache\Apache2.2.11\conf (e.g. C:\wamp\bin\apache\Apache2.2.11\conf)
Then add the following code:
AddType text/html .shtml
Options +Includes
AddOutputFilter INCLUDES .shtml
**The above code should be above "<Directory />" in httpd.conf file**
Then find "Options Indexes FollowSymLinks" and replace it with:
Options +Indexes +FollowSymLinks +Includes
Restart wamp and enjoy.

遵循这些步骤对我有用。

I was experiencing this same problem until I found this link -

http://www.roseindia.net/tutorial/php/phpbasics/Setting-Up-SSI-On-Wamp.html

The gist of the answer is below. It seems the lines need to be added in a specific location within the file. They also suggested a find & replace on the FollowSymLinks option -

How to add SSI (Serverside include support in WAMP)?
Open http.conf file from <your drive):\wamp\bin\apache\Apache2.2.11\conf (e.g. C:\wamp\bin\apache\Apache2.2.11\conf)
Then add the following code:
AddType text/html .shtml
Options +Includes
AddOutputFilter INCLUDES .shtml
**The above code should be above "<Directory />" in httpd.conf file**
Then find "Options Indexes FollowSymLinks" and replace it with:
Options +Indexes +FollowSymLinks +Includes
Restart wamp and enjoy.

Following these steps worked for me.

栀子花开つ 2025-01-02 03:49:40

我认为这可能会起作用,而不是 < !--#include 文件:

<!--#include virtual="menu.shtml" -->

我的 AddType text/html .shtml 行下也有这个:

AddOutputFilter INCLUDES .shtml

仅供参考,我不是专家,我只是查看了我自己的服务器是如何设置的。我希望它有帮助

I think this might work instead of < !--#include file:

<!--#include virtual="menu.shtml" -->

I also have this under my AddType text/html .shtml line:

AddOutputFilter INCLUDES .shtml

fyi I'm not an expert, I just looked at how my own server is set up. I hope it helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文