URL Re-Writing ASP.NET ( UrlRewriter.net )

351 Views Asked by At

Ok we have the following re-written URL using UrlRewriter.net

/category/games/21

using the following expression.

<rewrite url="~/Category/(.+)/(.+)" to="~/category.aspx?CatId=$2" />

however google can attach the following,

/category/games/21?gclid=clickIdHere

this would need to be re-written to,

/category.aspc?CatId=21&gclid=clickIdHere

Can anyone help suggest an expression that will work with the above?

I suppose somthing like...

<rewrite url="~/Category/(.+)/(.+)?gclid=(.+)" to="~/category.aspx?
CatId=$2&gclid=$3" />
1

There are 1 best solutions below

1
On BEST ANSWER

should be like

<add name="category" virtualUrl="^~/Category.aspx/(.*)/(.*)" destinationUrl="~/Category.aspx?CatID=$1&amp;gclid=$2" ignoreCase="true" rewriteUrlParameter="ExcludeFromClientQueryString" />