我有一个小网站,我在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 ='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头插件,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
答案 0 :(得分:0)
我希望我必须为www.mydomain.com创建一个新的虚拟目录,然后将其重定向到mydomain.com,但这看起来很尴尬。