default.aspx.cs:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("product/item=33");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Registration");
}
点击商品 URL:http://localhost:3052/WebSite1/product/item=33
点击注册 URL:http://localhost:3052/WebSite1/Registration
3 |
< section name = "urlrewritingnet" |
4 |
restartOnExternalChanges = "true" |
5 |
requirePermission ="false" |
6 |
type="UrlRewritingNet.Configuration.UrlRewriteSection, |
7 |
UrlRewritingNet.UrlRewriter" /> |
3 |
< add name = "UrlRewriteModule" |
4 |
type = "UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" /> |
3 |
< add name = "RewriteOnDomain" virtualUrl = "^http\://(.*)/product/item=(.*)" rewriteUrlParameter = "ExcludeFromClientQueryString" destinationUrl = "~/ProductDetails.aspx?productCode=$2" rewrite = "Domain" ignoreCase = "true" /> |
4 |
< add name = "Rewrite" virtualUrl = "^http\://(.*)/Registration" rewriteUrlParameter = "ExcludeFromClientQueryString" destinationUrl = "~/Registion.aspx" rewrite = "Domain" ignoreCase = "true" /> |
出处:学无止境-博客园 (http://www.cnblogs.com/zengxiangzhan/)