Board logo

标题: dvbbs=>Discuz! X保持搜索引擎带来的流量之rewrite 规则(apache版和IIS版) [打印本页]

作者: 白乐天    时间: 2017-1-31 18:38     标题: dvbbs=>Discuz! X保持搜索引擎带来的流量之rewrite 规则(apache版和IIS版)

最近给一个客户写的,分享一下给用得上的人吧。呵呵

IIS版
  1. [ISAPI_Rewrite]

  2. # 3600 = 1 hour
  3. CacheClockRate 3600

  4. RepeatLimit 32

  5. # Protect httpd.ini and httpd.parse.errors files
  6. # from accessing through HTTP

  7. RewriteRule ^(.*)/index\.asp\?[bB]oard[iI][dD]=(\d+)$ $1/forum\.php\?mod=forumdisplay&fid=$2
  8. RewriteRule ^(.*)/dispbbs\.asp\?[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)$ $1/forum\.php\?mod=viewthread&tid=$3
  9. RewriteRule ^(.*)/index\.asp\?[bB]oard[iI][dD]=(\d+)&[pP]age=(\d+)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3
  10. RewriteRule ^(.*)/dispbbs\.asp\?[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&page=(\d+)$ $1/forum\.php\?mod=viewthread&tid=$3&page=$4
  11. RewriteRule ^(.*)/dispbbs\.asp\?[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&authorid=(\d+)$ $1/forum\.php\?mod=viewthread&tid=$3&page=1&authorid=$4
  12. RewriteRule ^(.*)/dispbbs\.asp\?[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&authorid=(\d+)&page=(\d+)&star=(\d+)$ $1/forum\.php\?mod=viewthread&tid=$3&page=$6
  13. RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
  14. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
  15. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
  16. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
  17. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
  18. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
  19. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
  20. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
  21. RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
复制代码
Apache版
  1. <IfModule mod_rewrite.c>
  2. # 将 RewriteEngine 模式打开
  3. RewriteEngine On

  4. # Rewrite 系统规则请勿修改

  5. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)$
  6. RewriteRule ^index\.asp$ forum.php?mod=forumdisplay&fid=%1 [L]
  7. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=([0-9]+)&[iI][dD]=([0-9]+)$
  8. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2 [L]
  9. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[pP]age=(\d+)$
  10. RewriteRule ^index\.asp$ forum.php?mod=forumdisplay&fid=%1&page=%2 [L]
  11. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&TopicMode=(\d+)&List_Type=&[pP]age=(\d+)$
  12. RewriteRule ^index\.asp$ forum.php?mod=forumdisplay&fid=%1&page=%3 [L]
  13. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&[pP]age=(\d+)$
  14. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2&page=%3 [L]
  15. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&authorid=(\d+)$
  16. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2&page=1&authorid=%3 [L]
  17. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&authorid=(\d+)&[pP]age=(\d+)&star=(\d+)$
  18. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2&page=%4&authorid=%3 [L]
  19. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&[pP]age=(\d+)&move=next$
  20. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2&page=%3 [L]
  21. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&[pP]age=(\d+)&star=(\d+)$
  22. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2&page=%3 [L]
  23. RewriteCond %{QUERY_STRING}  ^[bB]oard[iI][dD]=(\d+)&[iI][dD]=(\d+)&star=(\d+)$
  24. RewriteRule ^dispbbs\.asp$ forum.php?mod=viewthread&tid=%2 [L]

  25. RewriteCond %{QUERY_STRING} ^(.*)$
  26. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
  27. RewriteCond %{QUERY_STRING} ^(.*)$
  28. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
  29. RewriteCond %{QUERY_STRING} ^(.*)$
  30. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
  31. RewriteCond %{QUERY_STRING} ^(.*)$
  32. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
  33. RewriteCond %{QUERY_STRING} ^(.*)$
  34. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
  35. RewriteCond %{QUERY_STRING} ^(.*)$
  36. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
  37. RewriteCond %{QUERY_STRING} ^(.*)$
  38. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
  39. RewriteCond %{QUERY_STRING} ^(.*)$
  40. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
  41. RewriteCond %{QUERY_STRING} ^(.*)$
  42. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1
  43. </IfModule>
复制代码


附件: 伪静态规则.rar (2017-1-31 18:38, 1.57 KB) / 下载次数 177
http://bbstobbs.com/attachment.php?aid=267&k=fbddb1e5a7bf8d63184a128f0e2a0657&t=1493018882




欢迎光临 论坛转换网 (http://bbstobbs.com/) Powered by Discuz! 7.0.0