Forum Moderators: phranque
I have 4 mod rewrite statements:
RewriteRule ^TLA/([0-9]+)/index.htm$ TLA/index.php?league=$1
RewriteRule ^TLA/([0-9]+)/(.+)/index\.htm$ TLA/index.php?league=$1&team=$2
RewriteRule ^TLA/([0-9]+)/(.+)/([0-9]+)/index\.htm$ TLA/index.php?league=$1&team=$2&category=$3
RewriteRule ^TLA/([0-9]+)/(.+)/(.+)/(.+)\.htm$ TLA/index.php?league=$1&team=$2&category=$3&product=$4
http://www.example.com/1/index.htm
http://www.example.com/1/ALA/index.htm
http://www.example.com/1/ALA/2/3.htm
All work meaning the $_GET variables are matched up correctly.
However,
http://www.example.com/1/ALA/2/index.htm
Does not work. It registers the $_GET['team'] variable as ALA/2 and no $_GET['category'] variable as opposed to registered the $_GET['team'] variable as ALA and the $_GET['category'] variable as 2.
I don't understand why the transition from my first to second rewrite statement would work, but not the transition from the 2nd to 3rd.
Please help. Thanks in advance!
That is, the (.+) "consumes" everything up to the index part.
Three things to do:
- Add
[L] to the end of every rule. (.+) to ([^/]+) or similar (except for the very last one in the very last rule which should be ([^\.]+) instead).