Forum Moderators: phranque
1. www.example.com/food/fruit/
2. www.example.com/food/fruit/apples/
I have the following rewrite rule for the 1st instance:
RewriteRule ([A-Za-z_-]+)/([A-Za-z_-]+) directory.php?one=$1&two=$2
And the following rewrite rule for the 2nd instance:
RewriteRule ([A-Za-z_-]+)/([A-Za-z_-]+)/([A-Za-z_-]+) directory.php?one=$1&two=$2&three=$3
When I enter the 1st URL, it works correctly, $1 = food and $2 = fruit.
However, when I enter the 2nd URL, $1 = php, $2 = fruit, and $3 = apples.
Any help would be appreciated. It would be nice if I could figure out a way to take care of all possible iterations with one line (ex: www.example.com/food/fruit/apples/red/golden-delicious)
Thanks!
[edited by: jdMorgan at 8:06 pm (utc) on Jan. 29, 2008]
[edit reason] example.com [/edit]
Just some general suggestions:
[added]You also need to anchor your patterns properly using "^" and "$". [/added]
Jim
[edited by: jdMorgan at 8:14 pm (utc) on Jan. 29, 2008]