views:

18

answers:

1

Hi!

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!

A: 

This solved my problem

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