开发者

Catching url in htaccess rewrite condition

I got this url

/search/renttype-all.place-all.type-all.bedrooms-all.0.0/

I want to get the text after the second "/" and the third "/". The URL can end at the third "/" or 开发者_运维技巧go on with more text and "/". I have been trying with a lot of rules but never got any to work. My last try was

RewriteRule ^search/(.+)/$ index.php?Search=0&Arg=$1 [NC]
RewriteRule ^search/(.+)/(.+)$ index.php?Search=0&Arg=$1 [NC]

Anyone that can show me how to make a rule that works? :) Thanks for reading my question!


This solved my problem

RewriteRule ^search/([^/]+)/ index.php?Search=0&Arg=$1 [NC]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜