开发者

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

开发者 https://www.devze.com 2022-12-11 18:00 出处:网络
Ok we have the following re-written URL using UrlRewriter.net /category/games/21 using the following expression.

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" />

how开发者_开发百科ever 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" />


should be like

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

精彩评论

暂无评论...
验证码 换一张
取 消