开发者

ASP.net redirect rule

开发者 https://www.devze.com 2023-02-21 20:28 出处:网络
<rewrite url=\"~/forum/viewtopic.php\\?t=([0-9]+)\" to=\"~/Handlers/PermRedirect.ashx?ID=$1&amp;a开发者_JS百科ction=forumpost\" processing=\"stop\"/>
<rewrite url="~/forum/viewtopic.php\?t=([0-9]+)" to="~/Handlers/PermRedirect.ashx?ID=$1&amp;a开发者_JS百科ction=forumpost" processing="stop"/>

This works great, but how to I make it redirect if t=([0-9]+) exists anywhere in the querystring?

Example URL's that it should match:

/forum/viewtopic.php?t=123&f=rgrg&rt=224

/forum/viewtopic.php?ty=345345&t=123&f=rgrg&rt=224

/forum/viewtopic.php?f=rgrg&rt=224&t=45

Can I make one rule to match them all? One ring, to rule them all.


Does this do the trick in your case?

url="~/forum/viewtopic.php\?.*t=([0-9]+).*
0

精彩评论

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