URL ReWriter for .NET
I am using this, but I have some hard to solve problems.
This is part of my code:
<rewrite url="/Dictionary/(.+)/(.+)" to="~/Dictionary.aspx?page=$2&&word=$1"/>
<rewrite url="/Dictionary" to="~/Dictionary.aspx"/>
When I type links like mywebsite.com/Dictionary/cat/4 the site loads only mywebsite.c开发者_如何学编程om/Dictionary.
Just a guess. Your second condition matches everything starting with /Dictionary. You probably want this
/Dictionary/?$
Just a suggestion but you can also try out IIS Url Rewrite 2 instead.
URL Rewrite 2 is a good option like XII said, comes with an user interface.
Regarding the regex, it would be more efficient for the regex engine to avoid backtracking; use the following expression instead:
"/Dictionary/([^/]+)/([^/]+)"
精彩评论