当前位置:首页 > CMS教程 > Discuz > 列表

Discuz论坛URL静态化规则urlrewrite

发布:smiling 来源: PHP粉丝网  添加日期:2014-12-06 16:12:51 浏览: 评论:0 

Discuz的伪静态规则官方都为我们提供了,下面我来给大家收集了在apache,iis各版本之间的伪静态规则,有需要了解的朋友可参考.

apache伪静态规则,代码如下:

  1. # 将 RewriteEngine 模式打开   
  2. RewriteEngine On   
  3.  
  4. # 修改以下语句中的 /bbs 为你的论坛目录地址,如果程序放在根目录中,请将 /bbs 修改为 /   
  5. RewriteBase /bbs   
  6.  
  7. # Rewrite 系统规则请勿修改   
  8. RewriteCond %{QUERY_STRING} ^(.*)$   
  9. RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1   
  10. RewriteCond %{QUERY_STRING} ^(.*)$   
  11. RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1   
  12. RewriteCond %{QUERY_STRING} ^(.*)$   
  13. RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1   
  14. RewriteCond %{QUERY_STRING} ^(.*)$   
  15. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&%1   
  16. RewriteCond %{QUERY_STRING} ^(.*)$   
  17. RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1   
  18. RewriteCond %{QUERY_STRING} ^(.*)$   
  19. RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&do=index&view=admin&$1=$2&%1 
  20. RewriteCond %{QUERY_STRING} ^(.*)$   
  21. RewriteRule ^blog-([0-9]+)-([0-9]+).html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1   
  22. RewriteCond %{QUERY_STRING} ^(.*)$   
  23. RewriteRule ^archiver/(fid|tid)-([0-9]+).html$ archiver/index.php?action=$1&value=$2&%1 

IIS6/IIS7.5 URL 静态化,代码如下:

  1. [ISAPI_Rewrite] 
  2.  
  3. # 3600 = 1 hour 
  4. CacheClockRate 3600 
  5.  
  6. RepeatLimit 32 
  7.  
  8. # Protect httpd.ini and httpd.parse.errors files 
  9. # from accessing through HTTP 
  10. RewriteRule ^(.*)/topic-(.+).html?*(.*)$ $1/portal.php?mod=topic&topic=$2&$3 
  11. RewriteRule ^(.*)/article-([0-9]+).html?*(.*)$ $1/portal.php?mod=view&aid=$2&$3 
  12. RewriteRule ^(.*)/forum-(w+)-([0-9]+).html?*(.*)$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$4 
  13. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html?*(.*)$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3&$5 
  14. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+).html?*(.*)$ $1/forum.php?mod=group&fid=$2&page=$3&$4  //开源软件:phpfensi.com 
  15. RewriteRule ^(.*)/space-(username|uid)-(.+).html?*(.*)$ $1/home.php?mod=space&$2=$3&$4 
  16. RewriteRule ^(.*)/([a-z]+)-(.+).html?*(.*)$ $1/$2.php?rewrite=$3&$4

Tags: Discuz论坛静态 urlrewrite

分享到: