Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] pw9.0 转到DZ3.0X 伪静态的问题希望大神解答一下

[复制链接]
tianjin66888 发表于 2013-8-18 21:26:18 | 显示全部楼层 |阅读模式
本帖最后由 tianjin66888 于 2013-8-18 21:46 编辑

原PW9.0 伪静态规则如下:
  1. # Helicon ISAPI_Rewrite configuration file
  2. # Version 3.1.0.79

  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteBase /
  6. RewriteRule ^(.*)-htm-tid-(.*).html$ $1.php?tid=$2
  7. RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
  8. RewriteCond %{REQUEST_FILENAME} !-f
  9. RewriteCond %{REQUEST_FILENAME} !-d
  10. RewriteRule  !\.(js|ico|gif|jpe?g|bmp|png|css)$ /bbs2/index.php [L]
  11. </IfModule>
复制代码
PW 9.0  列表形式:thread-htm-fid-{fid}-{page}.html             阅读页形式:read-htm-tid-{tid}-{page}.html

现在转换为DZ3.0X 后根据
https://discuz.dismall.com/thread-1880018-1-1.html
  1. RewriteEngine On

  2. # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
  3. RewriteBase /discuz
  4. RewriteRule ^thread-htm-fid-(\d+)((-type-(\d+))*(-page-(\d+))*)*\.html.*$ forum.php?mod=forumdisplay&fid=$1&filter=type&typeid=$4&page=$6 [R=301]
  5. RewriteCond %{QUERY_STRING} ^fid-(\d+)((-.+-(\d+))*\.html)*$
  6. RewriteRule ^thread\.php forum.php?mod=forumdisplay&fid=%1&page=%3 [R=301]
  7. RewriteCond %{QUERY_STRING} ^fid=(\d+)&type=(\d+)$
  8. RewriteRule ^thread\.php forum.php?mod=forumdisplay&fid=%1&filter=type&typeid=%2 [R=301]
  9. 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]
  10. RewriteCond %{QUERY_STRING} ^tid=(\d+)(&page=(\w+)(&fpage=(\d+))*)*$
  11. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&extra=page%3D1&page=%3 [R=301]
  12. RewriteCond %{QUERY_STRING} ^tid-(\d+)(-page-(\w+))*\.html$
  13. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&page=%3 [R=301]
  14. RewriteCond %{QUERY_STRING} ^tid-(\d+)-ordertype-desc\.html$
  15. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&extra=page%3D1&ordertype=1 [R=301]
  16. RewriteCond %{QUERY_STRING} ^f(\d+)\.html$
  17. RewriteRule ^simple/(index\.php)* forum.php?mod=forumdisplay&fid=%1 [R=301]
  18. RewriteCond %{QUERY_STRING} ^t(\d+)(_(\d+))*\.html$
  19. RewriteRule ^simple/(index\.php)* forum.php?mod=viewthread&tid=%1&archiver=1&page=%3 [R=301]
复制代码
这样的话 重定向REWRITE规则 保持了流量 也就是301 冲定向。
但是同样也出现了一个问题 就是 DZ3.0X 论坛现打开连接都是动态形式。
如果我 在伪静态规则中在加入DZ的规则是否可行?
代码如下:
  1. # Helicon ISAPI_Rewrite configuration file
  2. # Version 3.1.0.79

  3. # 将 RewriteEngine 模式打开
  4. RewriteEngine On

  5. # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
  6. RewriteBase /bbs
  7. RewriteRule ^thread-htm-fid-(\d+)((-type-(\d+))*(-page-(\d+))*)*\.html.*$ forum.php?mod=forumdisplay&fid=$1&filter=type&typeid=$4&page=$6 [R=301]
  8. RewriteCond %{QUERY_STRING} ^fid-(\d+)((-.+-(\d+))*\.html)*$
  9. RewriteRule ^thread\.php forum.php?mod=forumdisplay&fid=%1&page=%3 [R=301]
  10. RewriteCond %{QUERY_STRING} ^fid=(\d+)&type=(\d+)$
  11. RewriteRule ^thread\.php forum.php?mod=forumdisplay&fid=%1&filter=type&typeid=%2 [R=301]
  12. 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]
  13. RewriteCond %{QUERY_STRING} ^tid=(\d+)(&page=(\w+)(&fpage=(\d+))*)*$
  14. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&extra=page%3D1&page=%3 [R=301]
  15. RewriteCond %{QUERY_STRING} ^tid-(\d+)(-page-(\w+))*\.html$
  16. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&page=%3 [R=301]
  17. RewriteCond %{QUERY_STRING} ^tid-(\d+)-ordertype-desc\.html$
  18. RewriteRule ^read\.php forum.php?mod=viewthread&tid=%1&extra=page%3D1&ordertype=1 [R=301]
  19. RewriteCond %{QUERY_STRING} ^f(\d+)\.html$
  20. RewriteRule ^simple/(index\.php)* forum.php?mod=forumdisplay&fid=%1 [R=301]
  21. RewriteCond %{QUERY_STRING} ^t(\d+)(_(\d+))*\.html$
  22. RewriteRule ^simple/(index\.php)* forum.php?mod=viewthread&tid=%1&archiver=1&page=%3 [R=301]
  23. ------------------以下部分是在上面规则的基础上添加的DZ的规则,为了保证,论坛保持伪静态----------------------
  24. <font color="#ff0000">RewriteCond %{QUERY_STRING} ^(.*)$
  25. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
  26. RewriteCond %{QUERY_STRING} ^(.*)$
  27. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
  28. RewriteCond %{QUERY_STRING} ^(.*)$
  29. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
  30. RewriteCond %{QUERY_STRING} ^(.*)$
  31. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
  32. RewriteCond %{QUERY_STRING} ^(.*)$
  33. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
  34. RewriteCond %{QUERY_STRING} ^(.*)$
  35. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
  36. RewriteCond %{QUERY_STRING} ^(.*)$
  37. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
  38. RewriteCond %{QUERY_STRING} ^(.*)$
  39. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
  40. RewriteCond %{QUERY_STRING} ^(.*)$
  41. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1</font>
复制代码
otherbank 发表于 2013-8-26 11:17:52 | 显示全部楼层
这样完全可以的
就是phpwind的静态格式和dz的伪静态格式都跳转真实的动态地址
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-12-25 16:10 , Processed in 0.036028 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表