regexurlrewriting.net

urlrewriting.net and exact match


I am using urlrewriting.net to rewrite my URLs. One of my rules captures "/restaurant", but it seems it is a "contains"-rule in the sense that it will also capture eg. "/restaurant-italia" but I would like it to only capture the exact match "/restaurant".

My rule looks like this:

<add name="city_Restaurant_searchRule" virtualUrl="^~/(.*)/restaurant" destinationUrl="~/search.aspx?cityUrl=$1&amp;category=restaurant" rewriteUrlParameter="ExcludeFromClientQueryString" ignoreCase="true" xmlns="" />

Any help is appreciated

thanks Thomas


Solution

  • Maybe adding $ at the end of virtualUrl value will help.