标签: asp.net regex url-rewriting
我正在尝试制作重写规则,以检查网址是以.htm还是.html结尾,但不包含Archive.aspx。
.htm
.html
Archive.aspx
网址开头就像
www.contoso.com/test.htm (or .html)
最终会像
www.contoso.com/Archive.aspx?page=/test.htm
如何使用正则表达式执行此操作?
答案 0 :(得分:1)
您可以使用否定前瞻:(?!Archive\.aspx).*\.html?$
(?!Archive\.aspx).*\.html?$