首页 > CMS建站 > Discuz > 正文

discuz 2.5伪静态规则详解介绍

2020-10-12 19:55:49
字体:
来源:转载
供稿:网友

本文章给各位朋友介绍关于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 //开源软件:Cuoxin.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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表