ios - Facebook 共享链接无法在 FB iOS 应用程序内浏览器中打开

标签 ios facebook apache hyperlink

我们在运行 Apache 的 Ubuntu 14 服务器上部署了一个网站。该网站使用 SSL 证书(因此您可以通过 https 访问)并且对所有没有 https 的传入请求进行重定向。

好的,所以 网站在桌面浏览器和移动浏览器中按预期工作,但是,当用户点击链接(来自 Facebook iOS 应用程序)时,应用程序内浏览器会尝试打开网站并返回类似“链接无效,请重试”的消息(不是确切的英文消息)。

经过大量研究后,我仍然不清楚这会发生什么(只是在谷歌上发现了几个 Unresolved 案例),所以我首先要查看服务器配置。

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>

.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]

之前的配置在所有浏览器中都运行良好,只是在使用 Facebook iOS 应用程序内浏览器加载时不会加载(甚至不会进入 Apache 访问日志)。

非常感谢您的帮助!提前感谢您的宝贵时间。

最佳答案

在使用@CBoroe 建议的 SSL 检查器分析 url 后,我发现缺少需要添加的中间证书配置,因为我们使用的是 Apache < 2.4.8 版本。

我们只需添加 SSLCertificateChainFile/home/cert_ssl/intermediate.crt 指令。代码的最后 SSL 部分如下所示:

SSLEngine on
SSLCertificateFile /home/ssl/www.domain.com.crt
SSLCertificateKeyFile /home/ssl/domain.com.key
SSLCertificateChainFile /home/ssl/intermediate.crt

希望这可以帮助遇到此问题的其他人。进行此更改后,重新启动 Apache:

service apache2 restart

一切都应该正常工作(您可以使用相同的 SSL 检查工具来验证它)。

感谢您的宝贵时间!

关于ios - Facebook 共享链接无法在 FB iOS 应用程序内浏览器中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35906209/

相关文章:

ios - 如果用户允许该应用程序,则从框架访问用户位置

apache - 使用 mod_proxy 进行反向代理,保留原始请求 URL

ios - AFNetworking/Blocks 代码在主线程上执行?

android - 如何在 Android 中直接在 Facebook 中分享我的应用程序?

iphone - 架构armv7的 undefined symbol ?

image - FB 调试器说我的 og :image should be larger, 即使它很大

apache - Apache白名单反向代理

perl - 如何重新加载催化剂中的配置

ios - 奇怪的裁剪行为

ios - 如何在使用移动视觉人脸检测器时点击 UIView 进行捕获