Facebook 在分享状态时无法识别 url
facebook doesnot recognize url when sharing status
我在 php 中制作了一个小脚本,它的作用是获取 url 并将其重定向到另一个网站,仅域名更改 url 其余部分保持不变
这是我的代码
.htacess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?path= [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>
我面临的问题是当我将此 url 粘贴到我的 Facebook 状态时
http://viralresort.com/2801
它读取网站的所有数据,包括图像。
http://viralresort.com/2660
但是上面的 url 无法被 facebook 识别,它显示空白数据
您好,尝试将 URL 输入 facebook 调试器。
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fjustfun4funny.com%2F2660
您还可以要求 Facebook 获取任何 URL 的新信息。希望对您有所帮助。
调试器很方便URL,你应该保留。有时信息需要时间才能缓存到 facebook 中。您可以另外添加 og:type 标签以将信息传递给 facebook。
我在 php 中制作了一个小脚本,它的作用是获取 url 并将其重定向到另一个网站,仅域名更改 url 其余部分保持不变 这是我的代码
.htacess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?path= [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>
我面临的问题是当我将此 url 粘贴到我的 Facebook 状态时
http://viralresort.com/2801
它读取网站的所有数据,包括图像。
http://viralresort.com/2660
但是上面的 url 无法被 facebook 识别,它显示空白数据
您好,尝试将 URL 输入 facebook 调试器。
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fjustfun4funny.com%2F2660
您还可以要求 Facebook 获取任何 URL 的新信息。希望对您有所帮助。
调试器很方便URL,你应该保留。有时信息需要时间才能缓存到 facebook 中。您可以另外添加 og:type 标签以将信息传递给 facebook。