如何在html中添加引用公共模块文件

1.首先需要修改apache的配置文件;

打开httpd.conf

搜索“AddType text/html .shtml”

搜索结果:

AddType text/html .shtml .html .htm

AddOutputFilter INCLUDES .shtml .html .htm

把这两行前面的#去掉。

然后搜索“Options Indexes FollowSymLinks”

在搜索到的那一行后面添加“ Includes”

即将该行改变为 Options Indexes FollowSymLinks Includes

保存httpd.conf,重起即可。

2.将内容碎片放到以inc结尾的文件中;

3.使用include标签引进inc碎片;

<!--#include file=“/inc/文件名.inc”-->

4.文件结尾以shtml;

 

posted @ 2016-01-07 13:34  bling-bling  阅读(1846)  评论(0编辑  收藏  举报