0
我想从我的国家访问我的网站,我想谷歌和脸书可以访问我的网站。所以,我看了对这些页面:php让谷歌和脸书访问我的网站
https://developers.facebook.com/docs/sharing/best-practices#crawl https://support.google.com/webmasters/answer/1061943?hl=en 我所著这个PHP代码:
<?php
$agent = $_SERVER['HTTP_USER_AGENT'];
if (!preg_match("/facebook/", $agent) && !preg_match("/bingbot/", $agent) && !preg_match("/Googlebot/", $agent) && $agent != 'Facebot')
{
$country = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
if($country != 'AZ')
{
$error = 'Sorry, we can only serve to Azerbaijan!';
include('error.php');
die;
}
}
?>
它可以在Facebook上。但是,当我想用谷歌获得我的页面速度结果时,我得到“对不起,我们只能服务于阿塞拜疆!”错误
如果我改变了大家谁使用谷歌的一个铬可以访问我的网站 – 2014-09-12 20:17:03
@AliyevRauf只需编辑它以匹配机器人和页面速度 – Isaac 2014-09-12 20:21:29