Tag: url预览模式: 普通 | 列表

phpwind转Discuz!X 部分url rewrite重写规则含IIS和Apache

  以iis的rewrite 为例, 以下为目前收集到的部分pw链接 rewrite到 discuz!X的地址 

XML/HTML代码
  1. RewriteRule ^(.*)/thread-htm-fid-(\d+)((-type-(\d+))*(-page-(\d+))*)*\.html$ $1/forum\.php\?mod=forumdisplay&fid=$2&filter=type&typeid=$5&page=$7  
  2. RewriteRule ^(.*)/thread\.php\?fid-(\d+)((-.+-(\d+))*\.html)*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$5  
  3. RewriteRule ^(.*)/thread\.php\?fid=(\d+)&type=(\d+)$ $1/forum\.php\?mod=forumdisplay&fid=$2&filter=type&typeid=$3  
  4. RewriteRule ^(.*)/read-htm-tid-(\w+)(-page-(\d+|e)(-fpage-(\d+))*)*\.html$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$6&page=$4  
  5. RewriteRule ^(.*)/read\.php\?tid=(\d+)(&page=(\w+)(&fpage=(\d+))*)* $1/forum\.php\?mod=viewthread&tid=$2&extra=page%3D1&page=$3  
  6. RewriteRule ^(.*)/read\.php\?tid-(\d+)(-page-(\w+))*\.html$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$6&page=$4  
  7. RewriteRule ^(.*)/read\.php\?tid-(\d+)-ordertype-desc\.html$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page%3D1&ordertype=1  
  8. RewriteRule ^(.*)/simple/(index\.php)*\?f(\d+)(_(\d+))*\.html $1/forum\.php\?mod=forumdisplay&fid=$3&archiver=1&page=$5  
  9. RewriteRule ^(.*)/simple/(index\.php)*\?t(\d+)(_(\d+))*\.html$ $1/forum\.php\?mod=viewthread&tid=$3&archiver=1&page=$5  

其实有了以上的规则 改apache的应该很容易
这里付上Apache Web Server(虚拟主机用户)规则

XML/HTML代码
  1. RewriteEngine On  
  2.   
  3. # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /  
  4. RewriteBase /discuz  
  5. RewriteRule ^thread-htm-fid-(\d+)((-type-(\d+))*(-page-(\d+))*)*\.html.*$ forum.php?mod=forumdisplay&fid=$1&filter=type&typeid=$4&page=$6 [R=301]  
  6. RewriteCond %{QUERY_STRING} ^fid-(\d+)((-.+-(\d+))*\.html)*$  
  7. RewriteRule ^thread\.php forum.php?mod=forumdisplay&fid=%1&page=%3 [R=301]  
  8. RewriteCond %{QUERY_STRING} ^fid=(\d+)&type=(\d+)$  
  9. RewriteRule ^thread\.php forum.php?mod=forumdisplay&fid=%1&filter=type&typeid=%2 [R=301]  
  10. RewriteRule ^read-htm-tid-(\w+)(-page-(\d+|e)(-fpage-(\d+))*)*\.html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$5&page=$3 [R=301]  
  11. RewriteCond %{QUERY_STRING} ^tid=(\d+)(&page=(\w+)(&fpage=(\d+))*)*$  
  12. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&extra=page%3D1&page=%3 [R=301]  
  13. RewriteCond %{QUERY_STRING} ^tid-(\d+)(-page-(\w+))*\.html$  
  14. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&page=%3 [R=301]  
  15. RewriteCond %{QUERY_STRING} ^tid-(\d+)-ordertype-desc\.html$  
  16. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&extra=page%3D1&ordertype=1 [R=301]  
  17. RewriteCond %{QUERY_STRING} ^f(\d+)\.html$  
  18. RewriteRule ^simple/(index\.php)* forum.php?mod=forumdisplay&fid=%1 [R=301]  
  19. RewriteCond %{QUERY_STRING} ^t(\d+)(_(\d+))*\.html$  
  20. RewriteRule ^simple/(index\.php)* forum.php?mod=viewthread&tid=%1&archiver=1&page=%3 [R=301]  

 

Tags: iis url rewrite phpwind Discuz

分类:PHP/JSP | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 203