Форуми / Cotonti / Support / Forum closed and Google bot

MecTruy
#1 17.04.2009 16:42
I want to closed my forum to All guess bot also ı want to come all google bots in my forum So how can ı do this ???

Google bot ?


sample code
if ($usr['id']<1) 
{ 
header("Location: message.php?msg=930"); 
}
Kurta sormuşlar senin ensen neden kalın ? diye, Kendi işimi kendim yaparımda ondan demiş...

Відредаговано: MecTruy (21.04.2009 19:26, 16 років тому)
Lombi
#2 21.04.2009 19:31
So you want to block everyone except googlebot? That's called cloaking and might get your site deindexed from google's database.

But if you still want to do it, i'd suggest just adding one extra logic block into that php file, if the agent contains the word 'googlebot'. That should solve it.
<a href="http://www.domenlo.com">Surreal Art</a>
MecTruy
#3 21.04.2009 19:39
Thanks for the answer Lombi but How will include a code that ?

incorrect code , does not work..

preg_match('#(google|yahoo|msn)#i', $_SERVER['HTTP_USER_AGENT'], $bot_ara);
if ($usr['id']==0 or !$bot_ara[1])
{
header("Location: message.php?msg=930");
}
Kurta sormuşlar senin ensen neden kalın ? diye, Kendi işimi kendim yaparımda ondan demiş...

Відредаговано: MecTruy (21.04.2009 19:42, 16 років тому)
Lombi
#4 21.04.2009 19:45
You hook it to header.first as a plugin or you include it in the core into header.inc.php
<a href="http://www.domenlo.com">Surreal Art</a>
Trustmaster
#5 21.04.2009 21:21
/* ====================
[BEGIN_SED_EXTPLUGIN]
Code=fclose
Part=header
File=fclose.header
Hooks=header.first
Tags=
Order=10
[END_SED_EXTPLUGIN]
==================== */
if (!defined('SED_CODE')) { die("Wrong URL."); }

if ($usr['id']==0 || !preg_match('#(google|yahoo|msn)#i', $_SERVER['HTTP_USER_AGENT']))
{
  header("Location: message.php?msg=930");
}
May the Source be with you!