0

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

所以,我认为没问题,我将创建一个重定向规则来将调用从 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 标头插件,将 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
4

1 回答 1

0

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

于 2013-04-21T17:40:20.600 回答