mod_rewrite $ 10值限制,如何克服这个?

时间:2012-12-12 21:39:19

标签: mod-rewrite

我有一个超过10个值的重写规则。我知道mod重写限制为9,我已经看过1或2个RewriteCond解决方案,但无法让它对我起作用。

我通过网络生成器生成了重写规则,因为我不完全了解如何正确编写规则。

这是我的重写规则:

RewriteRule ^([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)\.html$ /search_properties.php?search=$1&country=$2&search_home_type=$3&search_home_town=$4&search_home_area=$5&search_rent_sale=$6&price_min=$7&price_max=$8&bedrooms=$9&bathrooms=$10&furnished=$11&search_agent=$12&order_by=$13 [L]

知道如何克服10美元的限制吗?非常欢迎任何帮助或提示!

谢谢!

1 个答案:

答案 0 :(得分:0)

您可以将规则拆分为2条规则。像这样:

RewriteRule ^([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*-[^-]*-[^-]*-[^-]*-[^-]*-[^-]*)\.html$ ineedmorevariables-$9?search=$1&country=$2&search_home_type=$3&search_home_town=$4&search_home_area=$5&search_rent_sale=$6&price_min=$7&price_max=$8
RewriteRule ^ineedmorevariables-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*) search_properties.php?bedrooms=$1&bathrooms=$2&furnished=$3&search_agent=$4&order_by=$5&somethingelse=$6 [L,QSA]

我还没有测试过它。所有这些括号都让我发疯了。

PS。我看到最后一个参数($14)从未使用过。

相关问题