【问题标题】:wamp ssi not workingwamp ssi 不工作
【发布时间】:2012-01-12 11:44:27
【问题描述】:

我正在使用 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>

我错过了什么?

【问题讨论】:

    标签: html wamp ssi


    【解决方案1】:

    在您的项目根目录中添加一个带有以下内容的 .htaccess 文件。

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

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

    【讨论】:

    • 快速简单!谢谢
    【解决方案2】:

    在找到此链接之前,我遇到了同样的问题 -

    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.
    

    按照这些步骤对我有用。

    【讨论】:

      【解决方案3】:

      我认为这可能会代替

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

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

      AddOutputFilter INCLUDES .shtml
      

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-03-14
        • 2016-07-04
        • 2014-07-29
        • 2013-06-13
        • 2012-10-04
        • 2010-09-29
        • 1970-01-01
        • 2011-03-08
        相关资源
        最近更新 更多