# 将 RewriteEngine 模式打开
RewriteEngine On

# 修改以下语句中的 /discuz 为你的论坛目录地址，如果程序放在根目录中，请将 /discuz 修改为 /
RewriteBase /

RewriteCond %{HTTP_HOST} !^www.0753163.com$ [NC]
RewriteRule ^(.*)$ http://www.0753163.com/$1 [L,R=301]
RewriteRule ^([0-9a-z_]+)/m([0-9]+)$ http://www.0753163.com/$1/m$2/ [R=301,L]
RewriteRule ^discuzx$ http://www.0753163.com/discuzx/ [R=301,L]
RewriteRule ^wordpress$ http://www.0753163.com/wordpress/ [R=301,L]
RewriteRule ^dedecmsmb$ http://www.0753163.com/dedecmsmb/ [R=301,L]
RewriteRule ^phpwind$ http://www.0753163.com/phpwind/ [R=301,L]
RewriteRule ^joomla$ http://www.0753163.com/joomla/ [R=301,L]
RewriteRule ^phpcms$ http://www.0753163.com/phpcms/ [R=301,L]
RewriteRule ^ecms$ http://www.0753163.com/ecms/ [R=301,L]
RewriteRule ^ecshop$ http://www.0753163.com/ecshop/ [R=301,L]
RewriteRule ^shopex$ http://www.0753163.com/shopex/ [R=301,L]
RewriteRule ^html$ http://www.0753163.com/html/ [R=301,L]

RewriteCond %{REQUEST_URI} !image/admincp/getcolor.htm$
RewriteRule ^(.*)\.htm$  - [F,L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule .*/(.+).php$ $1.php?%1 [L,NC]

# Rewrite 系统规则请勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^special/(.+)/$ portal.php?mod=topic&topic=$1&%1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule forum-([0-9a-z_]+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule thread-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1 [L,NC] 

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^guide/(.+)/$ forum.php?mod=guide&view=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^guide/$ forum.php?mod=guide&view=index [L,NC]

# 会员空间静态化

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/$ $1home.php?mod=space&$2=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/thread.html$ $1home.php?mod=space&$2=$3&%1&do=thread&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/album.html$ $1home.php?mod=space&$2=$3&%1&do=album&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/wall.html$ $1home.php?mod=space&$2=$3&%1&do=wall&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/profile.html$ $1home.php?mod=space&$2=$3&%1&do=profile&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/blog.html$ $1home.php?mod=space&$2=$3&%1&do=blog&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/doing.html$ $1home.php?mod=space&$2=$3&%1&do=doing&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/home.html$ $1home.php?mod=space&$2=$3&%1&do=home&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/share.html$ $1share.php?mod=space&$2=$3&%1&do=share&view=me&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/reply.html$ $1home.php?mod=space&do=thread&view=me&type=reply&$2=$3&%1&from=space

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/following.html$ $1home.php?mod=follow&do=following&$2=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)user/(username|uid)(.+)/follower.html$ $1home.php?mod=follow&do=follower&$2=$3&%1

# 广播静态化

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^follow/$ home.php?mod=follow [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^follow/(.+)/$ home.php?mod=follow&view=$1 [L,NC]


# 淘贴静态化

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^collection/$ forum.php?mod=collection [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^collection/c(.+)/$ forum.php?mod=collection&action=view&ctid=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^collection/all.html$ forum.php?mod=collection&op=all [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^collection/my.html$ forum.php?mod=collection&op=my [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^collection/(.+).html$ forum.php?mod=collection&op=all&order=$1 [L,NC]

# 标签手机论坛静态化

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^tag/(.+)/$ misc.php?mod=tag&id=$1

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^tag/$ misc.php?mod=tag

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^shouji/$ misc.php?mod=mobile

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^bbs/$ forum.php

# 众筹
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/t([0-9]+)o([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:pass&tid=$1&order=$2&page=$3 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/t([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:pass&tid=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/t([0-9]+)o([0-9]+).html$ plugin.php?id=vu_tuan:pass&tid=$1&order=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/o([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:pass&order=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/t(.+).html$ plugin.php?id=vu_tuan:pass&tid=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/o(.+).html$ plugin.php?id=vu_tuan:pass&order=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/p(.+).html$ plugin.php?id=vu_tuan:pass&page=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/$ plugin.php?id=vu_tuan:list [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/t([0-9]+)o([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:list&tid=$1&order=$2&page=$3 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/t([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:list&tid=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/t([0-9]+)o([0-9]+).html$ plugin.php?id=vu_tuan:list&tid=$1&order=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/o([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:list&order=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/t(.+).html$ plugin.php?id=vu_tuan:list&tid=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/o(.+).html$ plugin.php?id=vu_tuan:list&order=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/p(.+).html$ plugin.php?id=vu_tuan:list&page=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/pass/$ plugin.php?id=vu_tuan:pass [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/t([0-9]+)o([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:shoplist&tid=$1&order=$2&page=$3 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/t([0-9]+)o([0-9]+).html$ plugin.php?id=vu_tuan:shoplist&tid=$1&order=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/o([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:shoplist&order=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/t([0-9]+)p([0-9]+).html$ plugin.php?id=vu_tuan:shoplist&tid=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/t(.+).html$ plugin.php?id=vu_tuan:shoplist&tid=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/o(.+).html$ plugin.php?id=vu_tuan:shoplist&order=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/p(.+).html$ plugin.php?id=vu_tuan:shoplist&page=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/f(.+)p(.+).html$ plugin.php?id=vu_tuan:shop&bid=$1&page=$2 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/f(.+).html$ plugin.php?id=vu_tuan:shop&bid=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/funder/$ plugin.php?id=vu_tuan:shoplist [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/p(.+).html$ plugin.php?id=vu_tuan:list&page=$1 [L,NC]

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^zhongchou/z(.+).html$ plugin.php?id=vu_tuan:view&gid=$1 [L,NC]

## 保留前面的部分可以不影响已经被搜索引擎收录的页面

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule /m([0-9]+)(/([0-9]+))?(/)?$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$5&page=$3&%1 [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([0-9a-z_]+)?(/)?$ forum.php?mod=forumdisplay&fid=$1 [L,NC]

RewriteEngine on RewriteCond % !^$
RewriteRule data/attachment/(.*).(php)$ – [F]
RewriteRule data/avatar/(.*).(php)$ – [F]
RewriteRule uc_server/data/(.*).(php)$ – [F]
RewriteRule uc_server/data/avatar/(.*).(php)$ – [F]
RewriteRule uc_server/data/tmp/(.*).(php)$ – [F]
RewriteRule uc_server/data/cache/(.*).(php)$ – [F]

<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>