好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 網站建設 > 建站知識 > 如何IIS_rewrite配置來實現DEDECMS TAG偽靜態的方法

如何IIS_rewrite配置來實現DEDECMS TAG偽靜態的方法

POST TIME:2017-11-08 21:06

這篇文章是說明怎么配置IIS Rewrite偽靜態,以及dedecms tag偽靜態的方法。
1、因為沒有像PHP自帶的ReWrite模塊,所以需要去下載IIS Rewrite模塊: 
在百度搜索一下IIS Rewrite IIS偽靜態組件下載一個
2、將下載下來IIS Rewrite IIS偽靜態組件壓縮包解壓到任意目錄,(比如解壓到:C:\Rewrite)。然后打開“控制面板”>>“管理工具”>>“IIS信息服務管理器”-“網站”-“您的站點 
”>>“屬性”。在“ISAPI篩選器”項點擊 “添加”,篩選器名稱填入Rewrite,可執行文件為C:\Rewrite\Rewrite.dll ; 
 
3、然后修改httpd.ini 文件,添加相應的過濾規則,例如: 
 
RewriteRule ^(.*)/([a-z0-9\-\_]+)$ $1/Default\.aspx\?id=$2 [I,O] 
http://localhost/Text 就會等同于 http://localhost/Default.aspx?id=Text 
 
RewriteRule ^(.*)/id_([a-z0-9\-]+)\.html$ $1/Default\.aspx\?id=$2 [I,O] 
http://localhost/id_Text.html 就會等同于 http://localhost/Default.aspx?id=Text 
 
^(.*)/html/([0-9]+)/([0-9]+)\.html$ $1/Default\.aspx\?id=$2&name=$3 
http://localhost/html/001/007.html 就等同于 http://localhost/Default.aspx?id=001&name=007 
 
DEDE的添加方法(注意:這里是正則方式): 
 
RewriteRule ^(.*)/tag/(.+)$ $1/tag\.php\?$2/ 
RewriteRule ^(.*)/tag/(.+)\.html$ $1/tag\.php\?$2 
 
4、重新啟動IIS就可以生效了(這一步很重要,每次修改httpd.ini后都要重啟 IIS 以加載配置。) 
 
5、然后修改DEDE相關函數: 
 
\include\inc_arcpart_view.php 
\include\inc_channel_unit_functions.php 
\include\inc_pubtag_make.php 
\include\inc_taglist_view.php 
 
即:把所有鏈接改為靜態地址:tag.php?/ ->tag/ 
 
然后再生成相關頁面就可以了。


收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266