0

I have the following URL rewrite rule:

<ConfigRule>
     <LookFor>/([^/]*)/([^/]*)/([^/]*)/</LookFor>
     <Exclude>/Admin/(.*)</Exclude>
     <SendTo>~/CategoryDetails.aspx?url=$3&amp;fullurl=/$1/$2/$3/&amp;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&amp;fullurl=/$1/$2/$3/&amp;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?

1 Answer 1

1

I suppose what you want is to use fullurl parameter instead of url in the ASP script generating your pages (CategoryDetails.aspx). Full path containing all three hierarchy levels is already passed into the rewritten url, so it's nothing really to do here with an url rewrite.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.