discuz httpd.ini 完美伪静态、防盗链、301重定向

作者:zqcheng    发布于7年前 (2011-06-13)    阅读:  272  次

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

# discuz重定向

RewriteCond Host: ^www.ntt8.net$

RewriteRule (.*) http://www.ldww.cn$1 [I,R]

#discuz 伪静态

RewriteRule ^(.*)/topic-(.+).html?*(.*)$ $1/portal.php?mod=topic&topic=$2&$3

RewriteRule ^(.*)/article-([0-9]+)-([0-9]+).html?*(.*)$ $1/portal.php?mod=view&aid=$2&page=$3&$4

RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1

RewriteRule ^(.*)/forum-(w+)-([0-9]+).html?*(.*)$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$4

RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html?*(.*)$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3&$5

RewriteRule ^(.*)/group-([0-9]+)-([0-9]+).html?*(.*)$ $1/forum.php?mod=group&fid=$2&page=$3&$4

RewriteRule ^(.*)/space-(username|uid)-(.+).html?*(.*)$ $1/home.php?mod=space&$2=$3&$4

RewriteRule ^(.*)/([a-z]+)-(.+).html?*(.*)$ $1/$2.php?rewrite=$3&$4

# discuz防盗链

RewriteCond Host: (.+)

RewriteCond Referer: (?!http://(?:www.lingdus.com)).+

RewriteRule .*.(?:gif|jpg|png) /block.png [I,O]

添加新评论