[英]Facebook shared link does not open in FB iOS App in-app browser
We have a website deployed in a Ubuntu 14 server running Apache. 我们在运行Apache的Ubuntu 14服务器中部署了一个网站。 The website uses an SSL certificate (so you can access through https) and has a redirection for all the incoming requests without https.
该网站使用SSL证书(因此您可以通过https进行访问),并且对所有传入请求(没有https)进行重定向。
Ok, so the website is working as expected in desktop browsers and mobile browsers, but, when users tap on the links (from the Facebook iOS app) the in-app browser tries to open the website and returns a message like "Link doesn't work, try again" (not the exact message in english). 好的,因此该网站可以在桌面浏览器和移动浏览器中正常运行,但是,当用户点击链接(来自Facebook iOS应用程序)时,应用内浏览器会尝试打开该网站并返回“链接没有”之类的消息t工作,请重试” (不是英文的确切信息)。
After a lot of research I still don't have a clear idea of what this can happen (just found a couple of unresolved cases on google), so I'd start by looking at the server configuration. 经过大量研究,我仍然不清楚这会发生什么(只是在google上发现了几个未解决的案例),因此,我将从查看服务器配置开始。
The apache configuration (IP and domains are samples): apache配置(IP和域是示例):
<VirtualHost 200.200.200.200:80>
ServerName www.domain.com
Redirect permanent / https://www.domain.com/
</VirtualHost>
<VirtualHost domain.com:80>
ServerName www.domain.com
Redirect permanent / https://www.domain.com/
</VirtualHost>
<VirtualHost www.domain.com:443>
ServerName www.domain.com
ServerAlias domain.com
SSLEngine on
SSLCertificateFile /home/ssl/www.domain.com.crt
SSLCertificateKeyFile /home/ssl/domain.com.key
ServerAdmin admin@domain.com
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
The .htaccess file: .htaccess文件:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
The previous configuration works fine in all browsers, it just doesn't load (doesn't even makes it to Apache access log) when loaded with Facebook iOS in-app browser. 先前的配置在所有浏览器中都可以正常运行,但在加载Facebook iOS应用内浏览器后,它只是不加载(甚至不进入Apache访问日志)。
Help is much appreciated! 非常感谢帮助! Thanks in advance for your time.
在此先感谢您的时间。
After analyzing the url with the SSL Checker suggested by @CBoroe, I find out that there was a missing intermediate certificate configuration that needed to be added because we're using Apache < 2.4.8 version. 在使用@CBoroe建议的SSL Checker分析了url之后,我发现由于我们使用的是Apache <2.4.8版本,因此需要添加缺少的中间证书配置。
We just had to add the SSLCertificateChainFile /home/cert_ssl/intermediate.crt directive. 我们只需要添加SSLCertificateChainFile /home/cert_ssl/intermediate.crt指令。 The final SSL part of the code looks like this:
代码的最后SSL部分如下所示:
SSLEngine on
SSLCertificateFile /home/ssl/www.domain.com.crt
SSLCertificateKeyFile /home/ssl/domain.com.key
SSLCertificateChainFile /home/ssl/intermediate.crt
Hope this helps someone else having this issue. 希望这可以帮助其他遇到此问题的人。 After this change, restart Apache with:
进行此更改后,请使用以下命令重新启动Apache:
service apache2 restart
And everything should work fine (you can use the same SSL checker tool to validate it). 一切都应该正常工作(您可以使用相同的SSL检查器工具进行验证)。
Thanks for your time! 谢谢你的时间!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.