`
xitong
  • 浏览: 6198932 次
文章分类
社区版块
存档分类
最新评论

使用ssi来配置服务器,会让html 也能实现动态加载变量

 
阅读更多

使用ssi来配置服务器,会让html 也能实现动态加载变量,尤同php中变量复制一样

可以先在配置文件中,配置网站中需要使用到的变量

例:config.html

<!--#set var='host' value='www.laobi.com'-->

index.html

<html>
    <head>
        <title>测试IIS</title>
    </head>
<!--#include file='config.html'-->

<input type="text" value="<!--#echo var='host' -->"/>
</html>

这样我们可以看到在index.html中可以配置文件

以上需要有apache的支持,apache配置ssi,加载ssi模块,在apache中搜索 ssi,

    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddOutputFilter INCLUDES .html
    AddOutputFilter INCLUDES .php

开启SSI后就可以使用其强大的ssi拓展





分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics