Catching url in htaccess rewrite condition
Posted
by Rickard
on Stack Overflow
See other posts from Stack Overflow
or by Rickard
Published on 2010-04-08T09:40:03Z
Indexed on
2010/04/08
9:43 UTC
Read the original article
Hit count: 506
.htaccess
|apache-regexp
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!
© Stack Overflow or respective owner