本文章給各位朋友介紹關于discuz 2.5偽靜態規則的在不同環境的寫法,包括有nginx,httpd.ini(iis),httpd.conf,.htaccess的各種寫法,各位朋友可參考.
Nginx偽靜態規則,代碼如下:
- rewrite ^([^.]*)/brand.html$ $1/plugin.php?id=sanree_brand last;
- rewrite ^([^.]*)/brand-index-(.+)-(.+)-(.+)-(.+).html$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5 last;
- rewrite ^([^.]*)/brand-(.+)-(.+).html$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3 last;
- rewrite ^([^.]*)/b/(.+).html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2 last;
httpd.ini,代碼如下:
- RewriteRule ^(.*)/brand.html(?(.*))*$ $1/plugin.php?id=sanree_brand&$3
- 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 //開源軟件:Vevb.com
- RewriteRule ^(.*)/brand-(.+)-([0-9]+).html(?(.*))*$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3&$5
- RewriteRule ^(.*)/b/([a-z0-9]+).html(?(.*))*$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2&$4
.htaccess,代碼如下:
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^brand.html$ plugin.php?id=sanree_brand&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- 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
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^brand-(.+)-([0-9]+).html$ plugin.php?id=sanree_brand&mod=$1&tid=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^b/([a-z0-9]+).html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$1&%1
httpd.conf,代碼如下:
- RewriteRule ^(.*)/brand.html?*(.*)$ $1/plugin.php?id=sanree_brand&$2
- RewriteRule ^(.*)/brand-index-(.+)-(.+)-(.+)-(.+).html?*(.*)$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5&$6
- RewriteRule ^(.*)/brand-(.+)-(.+).html?*(.*)$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3&$5
- RewriteRule ^(.*)/b/(.+).html?*(.*)$ $1/plugin.php?id=sanree_brand
新聞熱點
疑難解答