开发者

Catching url in htaccess rewrite condition

开发者 https://www.devze.com 2022-12-26 06:42 出处:网络
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 o

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

精彩评论

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