I am absolutely not an expert in this but by analogy with mvc routing: did you try to invert the two rules?
Because actually your request "/search/computers" matches both SearchMain and SearchCustom, so I guess it probably takes the first matching rule it finds, which in your case is SearchMain...
If you invert the rules, it will first try to match the SearchCustom, and only if there is no match, it will go further and check on SearchMain.
Understanding Urlrewriting
I have a search page which im trying to give friendly URLS to when an item is searched for. So added the below to my UrlRewriting
The plan is when a standard search is performed it should run SearchMain and when an item is searched for, SearchCustom should run.
For some reason SearchMain always runs even though my query URL is /search/computers (computers being the search value)
Where am i going wrong?
Hello J,
I am absolutely not an expert in this but by analogy with mvc routing: did you try to invert the two rules?
Because actually your request "/search/computers" matches both SearchMain and SearchCustom, so I guess it probably takes the first matching rule it finds, which in your case is SearchMain...
If you invert the rules, it will first try to match the SearchCustom, and only if there is no match, it will go further and check on SearchMain.
Hope it helps.
Cheers,
Michaƫl.
THANK YOU!! this wasted 1 day of my time and inverting the order resolved the issue. Many thanks
Great! Glad I could help :-)
is working on a reply...