问题描述
我正在使用asp.net 4.0和iis7.我正在使用Intelligencia dll执行URL重写.我有一个用户控件,其中包含指向不同页面的链接.在web.config文件中,我已经编写了以下代码
I am using asp.net 4.0 and iis 7. I am using Intelligencia dll to perform url rewriting . I have a user control which has the links to different pages. in web.config file i have written below code
<rewriter>
<rewrite url="~/(Product1/)*" to="~/Product.aspx?category=$1" />
</rewriter>
用于urlrewriting.它只是第一次正常工作,但从下一页加载开始.网址被重写,另一个/Product附加在链接中.
链接第一次是 http://localhost:1789/WebSite1/Product1/DVD
但是在我第二次点击此链接之后,链接为 http://localhost:1789/WebSite1/Product1/Product1/DVD .
每次页面加载都会添加Product1单词.
for urlrewriting. it just works fine first time but from next page load. the url is rewritten and another /Product gets appended in the link.
For first time the link is http://localhost:1789/WebSite1/Product1/DVD
but after i click on this link second time onwards the link is http://localhost:1789/WebSite1/Product1/Product1/DVD.
The Product1 word is getting added for every page load.
推荐答案
用于urlrewriting.它只是第一次正常工作,但从下一页加载开始.网址被重写,另一个/Product附加在链接中.
链接首次为 http://localhost:1789/WebSite1/Product1/DVD
但是在我第二次点击此链接之后,链接为 http://localhost:1789/WebSite1/Product1/Product1/DVD .
每次页面加载都会添加Product1单词.
for urlrewriting. it just works fine first time but from next page load. the url is rewritten and another /Product gets appended in the link.
For first time the link is http://localhost:1789/WebSite1/Product1/DVD
but after i click on this link second time onwards the link is http://localhost:1789/WebSite1/Product1/Product1/DVD.
The Product1 word is getting added for every page load.
<rewriter>
<rewrite url=" ../(Product1/)*" to=" ../Product.aspx?category=
这篇关于.NET 4.0中的URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!