I added to this code to index.php on opencart system.
if(!strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot"))
{
if($_SERVER["HTTP_CF_IPCOUNTRY"] =! 'UK')
{
echo "You can not see this page.";
die();
}
}
But i can see this page with proxy web sites from other countries. I want to only My Country IP and googlebot see this page.
You may want to try:
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'googlebot') !== false OR $_SERVER["HTTP_CF_IPCOUNTRY"] == 'UK') {
echo "GoogleBot and UK users will see this";
}else{
die("DENIED");
}