MecTruy |
|
---|---|
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ş...
|
|
This post was edited by MecTruy (2009-04-21 19:26, 16 years ago) |
Lombi |
|
---|---|
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 |
|
---|---|
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ş...
|
|
This post was edited by MecTruy (2009-04-21 19:42, 16 years ago) |
Lombi |
|
---|---|
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 |
|
---|---|
/* ====================
[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!
|