让apache也支持shtml
by admin on 六.08, 2009, under apache
朋友发了一堆他网站的文件过来,一看扩展名,shtml。好家伙,以前使用IIS的时候,默认安装就有这个选择。
先来了解一下,什么是shtml,其实就是服务端包含的html,英文简称为SSI => Server Side Include
默认的apache是不支持这个东东的,毕竟在服务端包含,还是要费点资源的。不过自己做测试的时候,也是省得把重复的模块重写。
打开 httpd.conf
查找: shtml
就会找到类似下面这样的设置
#
# Filters allow you to process content before it is sent to the client.
#
# 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
把上面的最后两行前面的“#”号去掉,重新启动apache,它就支持shtml了。