首页 新闻 赞助 找找看

页面跳转去掉querystring

0
[已解决问题] 解决于 2012-03-26 09:02

asp.net开发,将301状态,404状态,500状态进行处理,直接跳转到某一个页面,在web.config里面配置即可,直接上代码:

<customErrors redirectMode="ResponseRedirect" mode="On" defaultRedirect="http://www.xxx.cn">
      <error statusCode="301" redirect="http://www.xxx.cn"/>
      <error statusCode="404" redirect="http://www.xxx.cn"/>
      <error statusCode="500" redirect="http://www.xxx.cn"/>
    </customErrors>

但是在进行页面跳转的时候,总是带着querystring,像这种:

比如 http://www.xxx.com/?m=show&gameid=7491
301过后 他显示的网址为http://wash.abc.com/?m=show&gameid=7491

后面的querystring还是带着,如何将后面的去掉?

像这种,跳转之后,变成http://wash.abc.com/

乔乔lovefreedom的主页 乔乔lovefreedom | 初学一级 | 园豆:9
提问于:2012-03-23 18:17
< >
分享
最佳答案
0

试试:

<customErrors redirectMode="ResponseRedirect" mode="On" defaultRedirect="http://www.xxx.cn">
<error statusCode="301" redirect="http://www.xxx.cn?"/>
<error statusCode="404" redirect="http://www.xxx.cn?"/>
<error statusCode="500" redirect="http://www.xxx.cn?"/>
</customErrors>
dudu | 高人七级 |园豆:31075 | 2012-03-23 21:25

现在变成了这种样子,页面跳转之后,URL显示为http://www.xxx.cn?,可不可以变成这个样子http://www.xxx.cn

乔乔lovefreedom | 园豆:9 (初学一级) | 2012-03-23 22:06

@乔乔lovefreedom: 在 http://www.xxx.cn 使用URL重定向,从 http://www.xxx.cn? 重定向至http://www.xxx.cn

dudu | 园豆:31075 (高人七级) | 2012-03-23 22:37
其他回答(1)
1

使用url重定向可以实现,同样你也可以作用post传参啊,目标页面只要使用Request.Form[""]获取参数不就OK了。。。

KivenRo | 园豆:1734 (小虾三级) | 2012-03-24 06:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册