Redirect 此网页有一个重定向循环-IIS7

Redirect 此网页有一个重定向循环-IIS7,redirect,iis-7,web-config,redirect-loop,Redirect,Iis 7,Web Config,Redirect Loop,我有一个小网站,我在iFrame中有一个邮件列表联系人表单,一旦提交,我向邮件列表服务注册的回调页面就会被调用,显示在iFrame中,并要求用户检查他们的电子邮件。我注册的页面是。在vertify.html中,我使用“window.parent.document.getElementById('lightbox4').style.display='none';”关闭包含I框架的lightbox div。这一切都很好,只要用户最初访问,但是如果他们访问,那么调用“window.parent.doc

我有一个小网站,我在iFrame中有一个邮件列表联系人表单,一旦提交,我向邮件列表服务注册的回调页面就会被调用,显示在iFrame中,并要求用户检查他们的电子邮件。我注册的页面是。在vertify.html中,我使用“window.parent.document.getElementById('lightbox4').style.display='none';”关闭包含I框架的lightbox div。这一切都很好,只要用户最初访问,但是如果他们访问,那么调用“window.parent.document.getElementById('lightbox4').style.display='none';”不起作用,因为这是一个跨域请求

所以,我想没问题,我只需要创建一个重定向规则,将呼叫从www.mydomain.com转换到mydomain.com。但是现在,当我尝试访问www.mydomain.com或mydomain.com时,出现了错误“此网页有重定向循环”。在IIS7中,我有两个绑定,一个用于mydomain.com,另一个用于www.mydomain.com。我的DNS区域有一个mydomain.com的A记录和一个www.mydomain.com的CNAME记录

我在做什么蠢事吗?有什么方法可以调试这个吗?我可以在Firefox中看到,使用Live HTTP headers插件,URL被正确地从www.mydomain.com重定向到mydomain.com,但随后试图继续尝试将mydomain.com重定向到mydomain.com,从而产生了无尽的循环:

http://www.mydomain.com/

GET / HTTP/1.1
Host: www.mydomain.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

HTTP/1.1 302 Redirect
Content-Type: text/html; charset=UTF-8
Location: http://mydomain.com/
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Sun, 21 Apr 2013 15:20:12 GMT
Content-Length: 150
----------------------------------------------------------
http://mydomain.com/

GET / HTTP/1.1
Host: mydomain.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

HTTP/1.1 302 Redirect
Content-Type: text/html; charset=UTF-8
Location: http://mydomain.com/
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Sun, 21 Apr 2013 15:20:12 GMT
Content-Length: 150
----------------------------------------------------------
http://mydomain.com/

GET / HTTP/1.1
Host: mydomain.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

HTTP/1.1 302 Redirect
Content-Type: text/html; charset=UTF-8
Location: http://mydomain.com/
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Sun, 21 Apr 2013 15:20:12 GMT
Content-Length: 150
----------------------------------------------------------
and it keeps going until "This webpage has a redirect loop" is displayed

我希望我必须为www.mydomain.com创建一个新的虚拟目录,然后将其重定向到mydomain.com,但这似乎很尴尬