ssi,服务器端包含,<include file="">
一、什么是SSI
ssi,全称Server Side Include,中文名,服务器端包含。
SSI (Server Side Includes)是HTML页面中的指令,在页面被提供时由服务器进行运算,以对现有HTML页面增加动态生成的内容,而无须通过CGI程序提供其整个页面,或者使用其他动态技术。
对什么时候用SSI,而什么时候用某些程序生成整个页面的权衡,取决于页面中有多少内容是静态,有多少内容需要在每次页面被提供时重新计算。SSI是一种增加小段信息的好方法,诸如当前时间。如果你的页面大部分是在被提供时生成的,那就要另找方案了。
二、apache配置SSI
需要开启1、 include_module模块,但需要注意关闭如虚拟服务 http-vhost模块(请大神指教两个模块的联调),
LoadModule include_module modules/mod_include.so
2、Options 添加includes
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes
文件后缀一般为.shtml测试代码
<!--#include file="aa.html"--><br/>
Today is <!--#echo var="DATE_LOCAL" --><br/>
修改时间配置<!--#config timefmt="%A %B %d, %Y" --><br/>
Today is<!--#echo var="DATE_LOCAL" --><br/>
输出为
3、若需要指定其他后缀 如.html,可修改 http.conf, 添加后缀名
#
# 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 .html
AddOutputFilter INCLUDES .shtml .html
三、用途
<!--被包含文件与父文件存在于相同目录中。 -->
<!-- #include file = "myfile.inc" -->
<!--被包含文件位于脚本虚拟目录中。 -->
<!-- #include virtual = "/scripts/tools/global.inc" -->
<!--#include file="top.html"-->
<div>
这是main,正文内容
</div>
<!--#include file="foot.html"-->
虽然有包含代码,但http请中只请求了 index.html,所以得出文件的包含是在服务器中就完成了!
http://man.chinaunix.net/newsoft/ApacheManual/howto/ssi.html
ssi,服务器端包含,<include file="">的更多相关文章
- SSI服务器端包含注入
服务器端嵌入:Server Side Include,是一种类似于ASP的基于服务器的网页制作技术.大多数(尤其是基于Unix平台)的WEB服务器如Netscape Enterprise Server ...
- 文件包含漏洞File Inclusion
文件包含漏洞 目录遍历漏洞在国内外有许多不同的叫法,也可以叫做信息泄露漏洞.非授权文件包含漏洞等. 文件包含分类 LFI:本地文件包含(Local File Inclusion) RFI:远程文件包含 ...
- Windows Azure 网站 (WAWS) 中的服务器端包含 (SSI)
编辑人员注释:本文章由 Windows Azure 网站团队的项目经理Erez Benari 撰写. Windows Azure 网站客户普遍关心的一个问题是关于我们对服务器端包含(Server ...
- 服务器端包含 SSI简介
服务器端包含 SSI,是英文 Server Side Includes的简写.SSI是一种可以指挥服务器动态声称网页内容的HTML指令. 通常SSI可以用来确保网页中的一些通用内容,比如版权信息.联系 ...
- jsp的静态包含与动态包含:<%@ include file="" %>和<jsp:include page=""></jsp:include>区别与分析
<%@ include file="" %>是将文件原封不动的copy进现有的文件中,像是拼接好后,再编译成为servlet运行. <jsp:include pa ...
- 玩转Web之Jsp(一)-----jsp中的静态包含(<%@include file="url"%>)与动态包含(<jsp:include>)
在jsp中include有两种形式,其中<%@include file="url"%>是指令元素,<jsp:include page="" f ...
- JSP基本语法--包含指令<%@include file="路径"%> <jsp:include page>
包含指令,真正改变的地方只有具体内容处: 方法1: 在每个jsp页面(HTML)都包含工具栏,头部信息,尾部信息,具体内容 方法2: 将工具栏,头部信息,尾部信息都分成各个独立的文件,使用的时候直接导 ...
- win7下使用IIS服务器及自定义服务器端包含模块(SSI)步骤
配置完过段时间就容易忘记,特此记录. 1.开启IIS服务器. 默认没有安装,需要先安装. 打开控制面板–> 打开“程序和功能”–> 左侧选择“启用或关闭windows功能”–> 找到 ...
- win8下使用IIS服务器及自定义服务器端包含模块(SSI)步骤
配置完过段时间就容易忘记,特此记录. 1.开启IIS服务器. 默认没有安装,需要先安装. 打开控制面板--> 打开“程序和功能”--> 左侧选择“启用或关闭windows功能”--> ...
随机推荐
- UVA12345 (带修改的莫队)
UVA12345 Dynamic len Problem : 给一个序列,每次询问一个区间里面的数字种类数量,或者修改某一个位置的值. Solution : 第一关键字分块排序左端点,第二关键字分块排 ...
- 魔咒词典--hdu1880(字符串 暴力)
http://acm.hdu.edu.cn/showproblem.php?pid=1880 不要想其他的 暴力就能过 #include <iostream> #include < ...
- Hadoop经典书籍资料收藏(35本)转
原文地址:http://www.hadoopor.com/thread-5128-1-2.html 1."Hadoop.Operations.pdf.zip" http://vdi ...
- [Bzoj1767][Ceoi2009]harbingers (树上斜率优化)
1767: [Ceoi2009]harbingers Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 451 Solved: 120[Submit][S ...
- 【Todo】秒杀系统 & 乐观锁 & Nginx反向代理
http://www.csdn.net/article/2014-11-28/2822858 1. 单点帐号验证,不用读,而是用写入,Redis,看是否加watch 2. 抢宝的最终购买冲突.包装称“ ...
- CentOS 6.x Inotify+Rsync
CentOS 6.x Inotify+Rsync yum -y install lrzsz [root@rsync ~]# mount -t nfs 10.6.100.75:/volume1/pace ...
- Android 四大组件学习之Service五
本节学习IntentService, 可能就有人问了. 什么是IntentService, IntentService有什么作用? 不是已经有了Service,那为什么还要引入IntentServic ...
- 接口测试工具--Fiddler 的使用
代码部分 Rules -> Customize Rules 打开Fiddler ScriptEditor,这里可以通过修改脚本中某些方法( OnBeforeRequest(oSession: ...
- 【翻译自mos文章】oracle db 中的用户账户被锁--查看oracle用户的尝试次数
參考原文: Users Accounts Getting Locked. (Doc ID 791037.1) 事实上这个文章是为oracle 别的软件产品写的,只是涉及到user 锁定问题.那还是跟d ...
- IOS报错:Unexpected ‘@’ in program
IOS开发中出现此错误的原因: 1.宏定义重复. 我在OC与C++混编的时候,由于C++中使用到了interface,在工程中年将interface从定义为struct,当引用此接口时候出现Unexp ...