RegEx Match Help
Posted: Mon May 26, 2008 5:40 pm
I'm using some rewrite rules that look like this:
Here's what should happen:
The first url rewriting works fine. It's the second one that won't work. I've went and simulated what the url would look like and tested the regex I have for the second rule against it and it worked perfectly (returned test/test1 and somevar=somevalue). I've no idea why it won't work here though. Does anyone have any alternative RegEx or can someone explain what I might be doing wrong? Thanks.
Code: Select all
RewriteEngine on
RewriteRule ^([A-Za-z].*)/ index.php?query=$1 [nc]
RewriteRule ^([A-Za-z].*)/\?(.*) index.php?query=$1&get=$2 [nc]Code: Select all
http://www.mysite.com/test/test1/ produces:
http://www.mysite.com/index.php?query=test/test1
http://www.mysite.com/test/test1/?somevar=value produces:
http://www.mysite.com/index.php?query=t ... =somevalue