httpd.ini静态规则设置不对。

2016-07-07 15:00 来源:www.chinab4c.com 作者:ecshop专家

先列出我的部分文件代码。
----------------------------------------------------------------------------------

RewriteRule ^(.*)/c-([0-9]+)-([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$

$1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9

RewriteRule ^(.*)/c-([0-9]+)-([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.html$

$1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6

RewriteRule ^(.*)/c-([0-9]+)-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$$1/category\.php\?

id=$2&brand=$3&page=$4&sort=$5&order=$6

RewriteRule ^(.*)/c-([0-9]+)-([0-9]+)-([0-9]+)(.*)\.html$ $1/category\.php\?

id=$2&brand=$3&page=$4

RewriteRule ^(.*)/c-([0-9]+)-([0-9]+)(.*)\.html$$1/category\.php\?id=$2&brand=$3


RewriteRule ^(.*)/c-([0-9]+)(.*)\.html$ $1/category\.php\?id=$2
-------------------------------------------------为httpd.ini里面的category分类列表静态规则

==================================
switch ($app)
{
case 'category':
if (empty($cid))
{
return false;
}
else
{
if ($rewrite)
{
$uri = 'c-' . $cid . '-';
if (isset($bid))
{
$uri .= $bid ;

}
if (isset($price_min))
{
$uri .= '-min'.$price_min;
}
if (isset($price_max))
{
$uri .= '-max'.$price_max;
}
if (isset($filter_attr))
{
$uri .= '-attr' . $filter_attr;
}
if (!empty($page))
{
$uri .= '-' . $page;
}
if (!empty($sort))
{
$uri .= '-' . $sort;
}
if (!empty($order))
{
$uri .= '-' . $order;
}
}
else
{
$uri = 'category.php?id=' . $cid;
if (!empty($bid))
{
$uri .= '&brand=' . $bid;
}
if (isset($price_min))
{
$uri .= '&price_min=' . $price_min;
}
if (isset($price_max))
{
$uri .= '&price_max=' . $price_max;
}
if (!empty($filter_attr))
{
$uri .='&filter_attr=' . $filter_attr;
}

if (!empty($page))
{
$uri .= '&page=' . $page;
}
if (!empty($sort))
{
$uri .= '&sort=' . $sort;
}
if (!empty($order))
{
$uri .= '&order=' . $order;
}
}
}

break;
-------------------------------为lib_common.php里面的category静态地址
==================================
if ($rewrite)
{
if ($rewrite == 2 && !empty($append))
{
$uri .=str_replace("+","-",urlencode(preg_replace('/[\.|\/|\?|&|\+|\\\|\'|"|,]+/', '', $append)));
}
$uri .= '.html';
----------------------------------为lib_common.php里面的静态地址的拼装

====================
我的问题是:看起来这个没什么错误的。而且其它的。例如goods页面也是类似的规则,就没错。但就是category有错。是不是我的规则有错。??