我们的用户正尝试在Word文档中embedded我们网站http://www.newsfixed.com/的链接,并且它们正在失败。 Word for Mac似乎对服务器configuration非常敏感,有时无法加载某些链接。 同样的问题似乎发生了链接到http://www.facebook.com/和http://www.pinterest.com/ (但链接到谷歌,微博,Instagram等都很好)
重现步骤:
在文档中键入以下URL,让Word将其转换为超链接:
http://www.google.com/ http://www.facebook.com/ http://www.theguardian.com/ http://www.nytimes.com/ http://www.pinterest.com/ http://www.instagram.com/ http://www.twitter.com/
点击链接 – 你会看到谷歌,卫报,纽约时报,Instagram和Twitter将工作,但Facebook和Pinterest(和我的网站www.newsfixed.com)不会。 Word报告错误,“无法打开http://www.pinterest.com/ 。找不到Internet服务器或代理服务器”:

它可以以某种方式与https://stackoverflow.com/questions/17926225/microsoft-office-hyperlink-issues相关,但我不知道如何!
从pinterest.com的HTTP响应看来,它似乎可能是服务302临时redirect到HTTPS版本而不是301 – 这是我的网站和pinterest有共同点。 所以我改变了我的服务器configuration,现在返回301s,但似乎没有任何区别。
我在Mac版本的旧版本 – 12.3.6。 我有报告说,这也发生在新版本的Word(但没有版本号,对不起)。 显然它只是在过去一周才开始发生,可能与SSL握手和Heartbleed补丁有关吗? (我当然是在本周重新获得证书)
服务器是Ubuntu上的标准Apache 2.4,通过mod_wsgi运行Django应用程序。
谢谢你的帮助,
布伦丹。
那么,我设法让它工作…
似乎Word不喜欢我的SSL证书(来自RapidSSL / GeoTrust),即使它通过了SSL检查站点( digicert sslshopper等)的所有检查。
所以我意识到我将不得不赶上我的Apache HTTPDconfiguration的Word用户代理:
RewriteEngine On # catch MS Office clients and send them to an HTTP redirect page BrowserMatchNoCase (word|excel|powerpoint|ms-office) browser=ms-office RewriteCond %{ENV:browser} ms-office RewriteRule ^/(?!ms\-office) http://%{HTTP_HOST}/ms-office?url=%{REQUEST_URI} [R=301,L] # everyone else can go to the HTTPS site RewriteCond %{HTTPS} off RewriteCond %{ENV:browser} !ms-office RewriteRule ^(?!ms\-office) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] ScriptAlias /ms-office /<path>/bin/msoffice-redirect.sh
其中“msoffice-redirect.sh”是一个简单的Bash CGI脚本(!),对安全页面执行元刷新:
#!/bin/bash URL=${QUERY_STRING//url=/} echo "Content-type: text/html" echo echo "<html><head><meta http-equiv='refresh' content='0;url=https://www.newsfixed.com${URL}'/></head><body></body></html>"
所以stream程是:
是的,这是一个完整的黑客。 我觉得很肮脏 但它的作品。 Word文档中的所有链接必须是http://虽然https://链接失败,但是至less我们现在可以在Word文档中包含一些链接。
我受到了“修复微软链接”Ruby应用程序的启发, Ruby应用程序在Ruby服务器中做了同样的事情。
我希望这能帮助别人避免我周末经历的痛苦!