apache AddOutputFilter html 支持Include
2016-04-06 11:43
429 查看
AddOutputFilter 就是针对某一种特定后缀的文件,添加一个处理程序(管道或者拦截器)
今天配置了mac 的 include
按照如下配置设置了Apache 的 SSI 功能
确认加载include.so模块,将注释去掉:
LoadModule include_module libexec/apache2/mod_include.so
AddType部分去掉这两段注释:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Directory目录权限里面找到
Options Indexes FollowSymLinks
增加Includes修改为:
Options Indexes FollowSymLinks Includes
重新启动Apache,测试:
但是发现没有生效,查找原因发现我的代码使用的主页面和子页面都是 html 后缀,但是文档中配置的是 .shtml 后缀,修改后配置文件为:
测试没有问题
参考文档:
https://httpd.apache.org/docs/current/mod/mod_mime.html#addoutputfilter
http://www.jb51.net/article/26438.htm
今天配置了mac 的 include
按照如下配置设置了Apache 的 SSI 功能
确认加载include.so模块,将注释去掉:
LoadModule include_module libexec/apache2/mod_include.so
AddType部分去掉这两段注释:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Directory目录权限里面找到
Options Indexes FollowSymLinks
增加Includes修改为:
Options Indexes FollowSymLinks Includes
重新启动Apache,测试:
但是发现没有生效,查找原因发现我的代码使用的主页面和子页面都是 html 后缀,但是文档中配置的是 .shtml 后缀,修改后配置文件为:
AddType text/html .html AddOutputFilter INCLUDES .html
<!--#include virtual="../mod.html" -->
测试没有问题
参考文档:
https://httpd.apache.org/docs/current/mod/mod_mime.html#addoutputfilter
http://www.jb51.net/article/26438.htm
相关文章推荐
- Wamp apache目录浏览时icons图标不显示解决方法
- Apache防御DDOS攻击
- 转载文章 ubuntu安装php Apache mysql 继承环境
- apache log4j-1.2.15的使用
- wamp-apache 虚拟网站映射设置三步骤
- Apache kafka 工作原理介绍
- Apache Commons-logging使用实例
- 使用Apache POI3.7操作word2007(docx)文本和图片内容
- 【Logstash 1.5.6】Apache Logs
- Apache连接数设置
- Apache服务器限制并发连接和下载速度
- apache最大连接数性能测试
- apache高负载性能调优
- apache配置中的Timeout和KeepAliveTimeout的解释
- centos下编译安装apache
- 阿里云主机windows系统Apache启用浏览器缓存的方法
- 编译安装apache
- apache2.4开启GZIP压缩
- 配置PHP与Apache2.4
- apache2.4中layout模块和ssi模块的冲突