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

discuz 2.5伪静态规则详解介绍

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

本文章给各位朋友介绍关于discuz 2.5伪静态规则的在不同环境的写法,包括有nginx,httpd.ini(iis),httpd.conf,.htaccess的各种写法,各位朋友可参考.

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

  1. rewrite ^([^.]*)/brand.html$ $1/plugin.php?id=sanree_brand last; 
  2. rewrite ^([^.]*)/brand-index-(.+)-(.+)-(.+)-(.+).html$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5 last; 
  3. rewrite ^([^.]*)/brand-(.+)-(.+).html$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3 last; 
  4. rewrite ^([^.]*)/b/(.+).html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2 last; 

httpd.ini,代码如下:

  1. RewriteRule ^(.*)/brand.html(?(.*))*$ $1/plugin.php?id=sanree_brand&$3 
  2. RewriteRule ^(.*)/brand-index-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html(?(.*))*$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5&$6 //开源软件:phpfensi.com 
  3. RewriteRule ^(.*)/brand-(.+)-([0-9]+).html(?(.*))*$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3&$5 
  4. RewriteRule ^(.*)/b/([a-z0-9]+).html(?(.*))*$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2&$4 

.htaccess,代码如下:

  1. RewriteCond %{QUERY_STRING} ^(.*)$ 
  2. RewriteRule ^brand.html$ plugin.php?id=sanree_brand&%1 
  3. RewriteCond %{QUERY_STRING} ^(.*)$ 
  4. RewriteRule ^brand-index-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ plugin.php?id=sanree_brand&mod=list&tid=$1&did=$2&filter=$3&listmode=$4&%1 
  5. RewriteCond %{QUERY_STRING} ^(.*)$ 
  6. RewriteRule ^brand-(.+)-([0-9]+).html$ plugin.php?id=sanree_brand&mod=$1&tid=$2&%1 
  7. RewriteCond %{QUERY_STRING} ^(.*)$ 
  8. RewriteRule ^b/([a-z0-9]+).html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$1&%1 

httpd.conf,代码如下:

  1. RewriteRule ^(.*)/brand.html?*(.*)$ $1/plugin.php?id=sanree_brand&$2 
  2. RewriteRule ^(.*)/brand-index-(.+)-(.+)-(.+)-(.+).html?*(.*)$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5&$6 
  3. RewriteRule ^(.*)/brand-(.+)-(.+).html?*(.*)$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3&$5 
  4. RewriteRule ^(.*)/b/(.+).html?*(.*)$ $1/plugin.php?id=sanree_brand

Tags: discuz静态规则 discuz伪静态

分享到: