【问题标题】:facebook doesnot recognize url when sharing status分享状态时,facebook 无法识别 url
【发布时间】:2015-03-02 14:40:56
【问题描述】:

我在 php 中制作了小脚本,它的作用是获取 url 并将其重定向到另一个网站,仅更改域名,其余 url 保持不变 这是我的代码

.htacess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]

index.php

<?php 
$url = 'http://justfun4funny.com/';
if (isset($_REQUEST['path']))
{
$url.=$_REQUEST['path'];
}

//var_dump($url);
header( "refresh:0;url=$url" ); ?>
<html>
Please wait while article is being loaded
<h1 style="color:blue;font-size:30"><a rel="canonical" href="<?php echo $url ?>">Click Here to Continue</a></h1>
<div style='display:none'>
 <iframe src="<?php echo $url?>"></iframe> 
</div>
</html>

我面临的问题是当我将此网址粘贴到我的 Facebook 状态时 http://viralresort.com/2801 它读取网站的所有数据,包括图片。
http://viralresort.com/2660 但上面的 url 无法被 facebook 识别它显示空白数据

【问题讨论】:

    标签: php facebook .htaccess


    【解决方案1】:

    您好,请尝试将 URL 输入 facebook Debugger。

    https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fjustfun4funny.com%2F2660

    您还可以要求 Facebook 获取任何 URL 的新信息。我希望这会有所帮助。

    调试器是一个方便的 URL,您应该保留。有时,信息需要时间才能缓存到 facebook 中。您还可以添加 og:type 标签以将信息传递给 facebook。

    【讨论】:

    • 谢谢兄弟,它确实帮助我找出了问题所在。
    • 干杯。祝你有美好的一天。
    猜你喜欢
    • 1970-01-01
    • 2012-02-13
    • 2020-09-01
    • 2019-01-19
    • 2020-12-20
    • 1970-01-01
    • 2017-02-22
    • 2012-12-19
    • 1970-01-01
    相关资源
    最近更新 更多