近来发现bing的搜索量也越来越大了,为了更好的对必应进行seo优化,我们可以把最新的网站文章链接提交给必应IndexNow,以此来加快必应快速收录网站文章链接,那么我们我如何使用php代码来实现提交网站文章链接到必应IndexNow呢?
PHP代码
<?php
$curl = curl_init();
$postdat = array(
'host' => 'yourdomAIn.com',
'key' => 'key',
'keyLocation' => 'yourdomain.com/key.txt',
'urlList' => array('yourdomain.com/1.html','yourdomain.com/2.html'),
);
$headers = array(
'Content-Type: application/json; charset=utf-8'
);
curl_setopt($curl, CURLOPT_URL,'httPs://api.indexnow.org/indexnow');
curl_setopt($curl, CURLOPT_POSTFIELDS,json_encode($postdat));
curl_setopt($curl, CURLOPT_HTTPHEADER,$headers);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($curl);
curl_close($curl);
echo '提交完成';
还没有评论,来说两句吧...