日期:2014-05-17  浏览次数:20476 次

请教一个apache rewrite rule 问题
前些天我仿照一个url rule 写了一个新的url rule 但是 前面匹配上了 .html? 后面的参数没有在url 中 不知道为什么 
原始的url
PHP code

RewriteRule ^/mall(?:\/([a-zA-Z0-9]+)(?:-([a-zA-Z0-9]+)(?:-([a-zA-Z0-9]+)(?:-([a-zA-Z0-9]+))?)?)?(?:-web2_([a-zA-Z0-9]+))?)\.html?$ /rebategoods.php?class=$1&small_class=$2&third_class=$3&fourth_class=$4&website_py=$5&%1



我仿照写的

PHP code

RewriteRule ^/search_(?:[^_]*)(?:\/([a-zA-Z0-9]+)(?:-([a-zA-Z0-9]+)(?:-([a-zA-Z0-9]+)(?:-([a-zA-Z0-9]+))?)?)?(?:-web2_([a-zA-Z0-9]+))?)\.html?$ /search.php?q=$1&class=$2&small_class=$3&third_class=$4&fourth_class=$5&website_py=$6&%1


第一个我打网址

http://buy.2345.com/mall/fuzhuang-nvzhuang-shangyi-txu.html?order=2&minprice=&maxprice=&p=1

参数为
Array ( [class] => fuzhuang [small_class] => nvzhuang [third_class] => shangyi [fourth_class] => txu [website_py] => [order] => 2 [minprice] => [maxprice] => [p] => 1 ) 

我写的网址:

http://buy.2345.com/search_aaa/fuzhuang-nvzhuang-shangyi-txu.html?order=2&minprice=&maxprice=&p=1

但是参数 只有
Array ( [q] => fuzhuang [class] => nvzhuang [small_class] => shangyi [third_class] => txu [fourth_class] => [website_py] => ) 
问号后面的都没有传进来 为什么呢

------解决方案--------------------
lz nb, 膜拜来了
------解决方案--------------------

------解决方案--------------------
这正则写的太长了, 是不是RewriteCond没有把query给C下来。