2012-07-19 71 views
0

我们有一个非常简单的URL重写规则,基本上使301重定向到另一个域:IIS URL重写模块unencoding查询字符串

<rewrite> 
    <rule> 
    <match url="^(default.aspx)?$" /> 
    <action type="Redirect" url="https://some.other.domain.com" /> 
    </rule> 
</rewrite> 

不幸的是,当遇到这样的URL:

http://original.domain.com/?returnUrl=https%3A%2F%2Fsome.url%2F

重定向URL看起来是这样的:

https://some.other.domain.com/?returnUrl=https://some.url/

通知的URL编码是如何丢失的。

这是URL重写模块中的错误吗?如果是这样,一个人怎么解决它?

回答

0

我想通了。重写规则仅指定了部分重定向URL。查询字符串编码现保存现在,我改变了这一点:

<action type="Redirect" url="https://some.other.domain.com"/> 

...这样的:

<action type="Redirect" url="https://some.other.domain.com/"/> 

(注意结尾的斜杠)