2007/07/30 09:12
文章作者:9Enjoy 转载请注明原文链接。
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
官方文档:http://www.itlearner.com/code/apache2.2/howto/ssi.html
Includes
Server-side includes provided by mod_include are permitted.
IncludesNOEXEC
Server-side includes are permitted, but the #exec cmd and #exec cgi are disabled. It is still possible to #include virtual CGI scripts from ScriptAliased directories.
也就是需要两步,
1.在虚拟主机块中加入,或者全局加
AddOutputFilter INCLUDES .htm
AddHandler server-parsed .htm
2.在Directory中的Options加入Includes参数,我觉得使用IncludesNOEXEC可能会更好。
<Directory "F:/hx/">
Options Indexes FollowSymLinks IncludesNOEXEC
</Directory>
一些错误的解决:
包含的文件出现如下提示:[an error occurred while processing this directive]
原因之一:先检查一下包含的文件路径对不对,文件是否存在。
如果正确,则问题出在包含的语句上。
<!--#include file="文件名称"-->
<!--#include virtual="文件名称"-->
file 文件名是一个相对路径,该路径相对于使用 #include 指令的文档所在的目录。被包含文件可以在同一级目录或其子目录中,但不能在上一级目录中。如表示当前目录下的的top.htm文档,则为file="top.htm"。
virtual 文件名是 Web 站点上的虚拟目录的完整路径。如表示相对于服务器文档根目录下hx目录下的top.htm文件;则为virtual="/hx/top.htm"
如果是上一级目录的子目录,就是使用路径../hx/top.htm时,需要使用Virtual,如果使用file,则会产生上面的提示。但在IIS下这样好像不会产生错误。

原来银行的叫号系统就是一台电脑改装的
让htm支持SSI方法二

