Apache支持 shtml和include文件解析
2015-11-11 13:15:38
11062
Apache支持include文件解析shtml首先要應(yīng)該修改Apache配置文件httpd.conf
1. 確認(rèn)加載include.so模塊,將注釋去掉:(就是代碼前的“#”)
LoadModule include_module modules/mod_include.so
2. AddType部分去掉這兩段注釋:(就是代碼前的“#”)
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml #這里注意如果你是html的文件就吧.shtml改為.html
3. Directory目錄權(quán)限里面找到:
Options Indexes FollowSymLinks
增加Includes修改為:
Options Indexes FollowSymLinks Includes

4. 重新啟動(dòng)Apache,測試:
新建一個(gè)index.html的文檔加入
<!-–#include file=”test.html”–->
Holle Word!,這是中間的內(nèi)容
新建一個(gè)test.htmll的文檔加入
<a href="http://www.tjdsmy.cn">藍(lán)隊(duì)網(wǎng)</a>
顯示:

會(huì)員登錄
賬號(hào)登錄還沒有賬號(hào)?立即注冊