首页 >后端开发 >php教程 >请问一个apache rewrite rule 有关问题

请问一个apache rewrite rule 有关问题

WBOY
WBOY原创
2016-06-13 10:36:22856浏览

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

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->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
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->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下来。
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn