IE6和IE7在重定向时发送没有主机名的HTTP / 1.1

时间:2009-09-30 10:42:25

标签: redirect internet-explorer-6 internet-explorer-7 apache2

我们在webapp中使用Redirect-after-Post模式。

有时我们的apache日志中会显示很少的错误日志,如下所示:

  

[error] [...]客户端发送没有主机名的HTTP / 1.1请求(参见RFC2616第14.23节):...

在我的访问日志中,它们显示为 [...]“GET / xyz / HTTP / 1.1”400 226“ - ”“ - ”72

这里发生的是:应用程序发送一个带有绝对URL的重定向,如下所示:

地点:http://www.kicktipp.de/demo/

今天我有三个浏览器请求我们重定向的URL,而不需要主机头:

  • “Mozilla / 4.0(兼容; MSIE 7.0; Windows NT 6.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)”
  • “Mozilla / 4.0(兼容; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; InfoPath.1 )
  • “Mozilla / 4.0(兼容; MSIE 7.0; Windows NT 5.1; Mozilla / 4.0(兼容; MSIE 7.0; Win32; WEB.DE); Mozilla / 4.0(兼容; MSIE 8.0; Win32; WEB.DE);. NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)“

这些都是正常访问,用户点击几页,然后获得重定向,但失败并出错。

我知道有些旧浏览器需要http / 1.1的帮助,所以我们有默认的debian setenv配置:

<IfModule mod_setenvif.c>

#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

#
# The following directive disables redirects on non-GET requests for
# a directory that does not include the trailing slash.  This fixes a 
# problem with Microsoft WebFolders which does not appropriately handle 
# redirects for folders with DAV methods.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

</IfModule>

每10000次重定向仅发生一次。但当然我想满足每个用户和每个浏览器。

你有什么暗示可以给我吗?是否需要在我们的mod_setenvif配置中添加更多浏览器?

1 个答案:

答案 0 :(得分:0)

根本原因可能类似于导致不相关问题中Accept header不一致的原因:

ACCEPT标题更改:

  • 页面缓存时
  • 更新引用时