I have the following URL rewrite rule:
<ConfigRule>
<LookFor>/([^/]*)/([^/]*)/([^/]*)/</LookFor>
<Exclude>/Admin/(.*)</Exclude>
<SendTo>~/CategoryDetails.aspx?url=$3&fullurl=/$1/$2/$3/&page=1</SendTo>
<IgnoreQueryStringInMatch>true</IgnoreQueryStringInMatch>
</ConfigRule>
Where $1, $2 and $3 equal a parent group, parent category and category respectively. What i'm trying to do is match a URL for example: /cars/car-parts/wheels/.
The regex does match the url pattern but i have a strange problem where if you have a category with the same name e.g. two with the name name/url "wheels", regardless of whether it's under a different parent/group, you'll be redirected to only one of the two e.g.
/bicycles/bicycle-parts/wheels/
and
/cars/car-parts/wheels/
Will both redirect to the same page.
I believe the culprit is this:
<SendTo>~/CategoryDetails.aspx?url=$3&fullurl=/$1/$2/$3/&page=1</SendTo>
Where ?url=$3 is only matching the last part of the url (wheels), so i guess what i'm asking is is there a way to include the group+parent+category in the url querystring so that it matches all three segments rather than just the end?