網站結構我有一個多區域基礎的網站,我根據IP address.Following將用戶重定向是根據自己國家的用戶重定向代碼。但是,此代碼阻止Googlebot訪問美國以外的網頁。什麼應該是理想的結構,以便googlebot可以訪問每個頁面,並且用戶按照他們的IP地址被重定向?提前致謝。的地理靶向網站
if ($country == "IN")
{
// do nothing
}
else if ($country == "BD" ")
{
header('Location:https://www.exmple.com/directory/bangladesh/index.php');
}
else if ($country == "PK" )
{
header('Location:https://www.exmple.com/directory/pakistan/index.php');
}
else if ($country == "LK")
{
header('Location:https://www.exmple.com/directory/srilanka/index.php');
}
else if ($country == "US")
{
header('Location:https://www.exmple.com/directory/usa/index.php');
}
else if ($country == "CA")
{
header('Location:https://www.exmple.com/directory/canada/index.php');
}
else if ($country == "GB")
{
header('Location:https://www.exmple.com/directory/uk/index.php');
}
else if ($country == "NG")
{
header('Location:https://www.exmple.com/directory/nigeria/index.php');
}
else
{
header('Location:https://www.exmple.com/directory/global/index.php');
}
也許設置會話變量,當有人第一次訪問,並將其重定向到你認爲他們想看看這個國家,但如果該變量設置當他們回到主頁時,他們避免重定向。因爲它不僅僅適用於Googlebot。如果加拿大的用戶想要查看英國的目錄,該怎麼辦?他們不能? –
請給出你想說的結構。 – rns
沒有結構性變化,只是沒有自動重定向基於IP地址。或者,如果你這樣做,只有改向第一時間,讓遊客穿越之後,你的整個網站,而不是你目前的猜測是什麼數據的訪問者(或由Googlebot)希望看到的策略。 –