0

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

ThomasD
  • 2,464
  • 6
  • 40
  • 56

1 Answers1

2

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

Alexey
  • 909
  • 6
  • 11
  • Hi Alexey. Hopefully you can crack this one as well. I now see that I need paging as well in the format virtualUrl="^~/(.*)/restaurant?page=2" where it should do an exact match on "restaurant" as you solved earlier, but still allow for the page-parameter. The page-parameter is not always there (eg. when you first hit the page and have not started paging yet). Thanks, Thomas – ThomasD Oct 14 '11 at 22:38
  • @user514090 See if this works: ^~/(.*)/restaurant(\?page=(\d+))?$ – Alexey Oct 14 '11 at 22:50