Discuz教程网

DX1.5伪静态规则 官方给的哦。绝对权威。

  [复制链接]
authicon 跏趺三昧 发表于 2010-10-5 10:30:40 | 显示全部楼层 |阅读模式

  1. Apache Web Server(独立主机用户)
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteCond %{QUERY_STRING} ^(.*)$
  5. RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
  6. RewriteCond %{QUERY_STRING} ^(.*)$
  7. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
  8. RewriteCond %{QUERY_STRING} ^(.*)$
  9. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
  10. RewriteCond %{QUERY_STRING} ^(.*)$
  11. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
  12. RewriteCond %{QUERY_STRING} ^(.*)$
  13. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
  14. RewriteCond %{QUERY_STRING} ^(.*)$
  15. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
  16. RewriteCond %{QUERY_STRING} ^(.*)$
  17. RewriteRule ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3&%1
  18. </IfModule>
  19. Apache Web Server(虚拟主机用户)
  20. # 将 RewriteEngine 模式打开
  21. RewriteEngine On

  22. # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
  23. RewriteBase /discuz

  24. # Rewrite 系统规则请勿修改
  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 ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1

  39. IIS Web Server(独立主机用户)
  40. [ISAPI_Rewrite]

  41. # 3600 = 1 hour
  42. CacheClockRate 3600

  43. RepeatLimit 32

  44. # Protect httpd.ini and httpd.parse.errors files
  45. # from accessing through HTTP
  46. RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
  47. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=view&aid=$2&page=$3&$4
  48. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
  49. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
  50. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
  51. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
  52. RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4

  53. IIS7 Web Server(独立主机用户)
  54. <rewrite>
  55. <rules>
  56. <rule name="portal_topic">
  57. <match url="^(.*/)*topic-(.+).html\?*(.*)$" />
  58. <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
  59. </rule>
  60. <rule name="portal_article">
  61. <match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" />
  62. <action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
  63. </rule>
  64. <rule name="forum_forumdisplay">
  65. <match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$" />
  66. <action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
  67. </rule>
  68. <rule name="forum_viewthread">
  69. <match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
  70. <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
  71. </rule>
  72. <rule name="group_group">
  73. <match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$" />
  74. <action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
  75. </rule>
  76. <rule name="home_space">
  77. <match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)$" />
  78. <action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
  79. </rule>
  80. <rule name="all_script">
  81. <match url="^(.*/)*([a-z]+)-(.+).html\?*(.*)$" />
  82. <action type="Rewrite" url="{R:1}/{R:2}.php\?rewrite={R:3}&{R:4}" />
  83. </rule>
  84. </rules>
  85. </rewrite>
  86. Zeus Web Server
  87. match URL into $ with ^(.*)/topic-(.+)\.html\?*(.*)$
  88. if matched then
  89. set URL = $1/portal.php?mod=topic&topic=$2&$3
  90. endif
  91. match URL into $ with ^(.*)/article-([0-9]+)-([0-9]+)\.html\?*(.*)$
  92. if matched then
  93. set URL = $1/portal.php?mod=view&aid=$2&page=$3&$4
  94. endif
  95. match URL into $ with ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$
  96. if matched then
  97. set URL = $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$4
  98. endif
  99. match URL into $ with ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$
  100. if matched then
  101. set URL = $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
  102. endif
  103. match URL into $ with ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$
  104. if matched then
  105. set URL = $1/forum.php?mod=group&fid=$2&page=$3&$4
  106. endif
  107. match URL into $ with ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$
  108. if matched then
  109. set URL = $1/home.php?mod=space&$2=$3&$4
  110. endif
  111. match URL into $ with ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$
  112. if matched then
  113. set URL = $1/$2.php?rewrite=$3&$4
  114. endif

  115. Nginx Web Server
  116. rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
  117. rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
  118. rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
  119. rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
  120. rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
  121. rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
  122. rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
  123. if (!-e $request_filename) {
  124. return 404;
  125. }
复制代码





上一篇:本版规则字体颜色修改方法
下一篇:sitemap生成器 FOR DISCUZ X1.5 伪静态版 支持百度,谷歌
authicon 不装饰你的梦 发表于 2011-1-30 18:00:30 | 显示全部楼层
这东西我收了!谢谢楼主!1314学习网真好!
authicon 13to 发表于 2011-1-31 22:55:10 | 显示全部楼层
明天看看1314学习网!
authicon test 发表于 2011-2-3 12:48:11 | 显示全部楼层
这个看看。。。。
authicon 听涛财富管道 发表于 2011-2-6 02:03:14 | 显示全部楼层
学习来了,谢谢
authicon 空心邂逅 发表于 2011-2-13 16:48:21 | 显示全部楼层
这个帖子不回对不起自己!我想我是一天也不能离开1314学习网
authicon hurq1 发表于 2011-2-13 23:45:09 | 显示全部楼层
寂寞轩社区,听寂寞在唱歌
authicon dddgm 发表于 2011-2-18 10:38:08 | 显示全部楼层
这东西我收了!谢谢楼主!1314学习网真好!
authicon 康桥2 发表于 2011-2-18 12:56:03 | 显示全部楼层
楼主太厉害了!楼主,I*老*虎*U!我觉得1314学习网真是个好地方!
authicon clarke0507 发表于 2011-2-19 00:42:27 | 显示全部楼层
楼主发贴辛苦了,谢谢楼主分享!我觉得1314学习网是注册对了!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-18 17:51

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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