apache mod_rewrite regex problem with multiple parameter

Posted by iko on Stack Overflow See other posts from Stack Overflow or by iko
Published on 2010-03-15T16:37:19Z Indexed on 2010/03/15 16:39 UTC
Read the original article Hit count: 273

Filed under:
|
|

Regular expressions have always been my pet peeves. Every time I think that I finally got it I have a new problem !

I want to catch url like this :

http://www.mydomain.com/boutique/blabla-1/bla-bla2/99/104
http://www.mydomain.com/boutique/blabla1/99

and eventually :

http://www.mydomain.com/boutique/blabla-1/bla-bla2/product1/99/104/55/

after a lot of tries and errors I came up with this which seems to work with http://www.gskinner.com/RegExr/ but not in apache

^.*/boutique/([a-zA-Z-]*)(/?[a-zA-Z-]*)/?([0-9]*)/?([0-9]*)/?$   boutique.php?c1=$3&c2=$4

(I was only working with the first two url so far)

MY apache rewrite log debug files are helpless :

pass through /Users/iko/Sites/mysite/boutique.php

I'm only interrested in getting the ids. Any help we'll be welcomed !

Thank you.

© Stack Overflow or respective owner

Related posts about mod-rewrite

Related posts about regex