2012-01-12 47 views
1

我正在使用wamp。我想使用SSI,所以我有些改变在httpd.conf线,但它似乎并不奏效:wamp ssi不工作

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> 

我在想什么?

回答

0

我认为这可能工作,而不是< - #include文件:

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

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

AddOutputFilter INCLUDES .shtml 

FYI我我不是专家,我只是看着我自己的服务器是如何建立的。我希望它能帮助

+0

我试过@pete它仍然不工作:( – Shruti 2012-01-12 15:30:02

1

我正经历着同样的问题,直到我发现这个链接 -

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. 

按照这些步骤为我工作。

5

添加到您的项目根目录下面的一个.htaccess文件。

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

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

+0

快速简单!谢谢 – kellycode 2015-01-05 16:35:22

+0

工作就像一个魅力谢谢:) – 2016-06-04 15:02:21