首先是下载Apache并安装:
http://archive.apache.org/dist/httpd/binaries/win32/httpd-2.2.21-win32-x86-no_ssl.msi
如何让apache支持.shtml 让apache支持include标签
修改conf目录下的httpd.conf文件:
1、 AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
2、在Options Indexes FollowSymLinks 后面添加 Includes
需重启apache
注意:
DocumentRoot "E:/Apache/htdocs"
<Directory "E:/Apache/htdocs">
E:/Apache/htdocs 为运行文件存放的地方
示例:
在E:/Apache/htdocs文件夹里添加下面两个shtml文件
1.header.shtml文件里写:
hello world
2.index.shtml文件里写:
<!--#include file="header.shtml"-->
最后,浏览器访问:http://localhost/index.shtml