Источник: https://dev.1c-bitrix.ru/community/forums/messages/forum6/topic89429/message452103/#message452103 |
Цитата |
---|
<?$curPage = $APPLICATION->GetCurPage(true); if(substr_count($curPage, "catalog")) { //Разрешаем индексацию канонических разделов по URL шаблонам $indexPatterns=array( "catalog/ulysse", "catalog/zenith", "catalog/longines", "catalog/tag_heuer", "catalog/hamilton", "catalog/oris", "catalog/rado", "catalog/mido", "catalog/hamilton", "catalog/balmain", "catalog/certina", "catalog/tissot", "catalog/casio", "catalog/g-shock", "catalog/seiko"); for($i=0; $i<count($indexPatterns); $i++) { if(substr_count($curPage,$indexPatterns[$i])) { $indexFollow=true; } } //Закрываем индексацию по URL шаблонам $noindexPatterns=array( "filter"); for($i=0; $i<count($noindexPatterns); $i++) { if(substr_count($curPage,$noindexPatterns[$i])) { $indexFollow=false; } } //Закрываем индексацию: все страницы с GET параметрами, кроме списков товаров if(!empty($_GET) && empty($_GET['PAGEN_1'])) { $indexFollow=false; } if(!$indexFollow) { echo "<met a name="robots" content="noindex, follow">\n"; } else { echo "<met a name="robots" content="index, follow">\n"; } } else { //Закрываем индексацию: страницы списков с главной и персональный раздел if(($curPage=="/index.php" && !empty($_GET)) || substr_count($curPage, "personal")) { echo "<met a name="robots" content="noindex, nofollow">\n"; } else { $APPLICATION->ShowMeta("robots", false, $bXhtmlStyle); } } echo '<met a http-equiv="Content-Type" content="text/html; charset='.LANG_CHARSET.'"'.($bXhtmlStyle? ' /':'').'>'."\n"; $APPLICATION->ShowMeta("keywords", false, $bXhtmlStyle); $APPLICATION->ShowMeta("description", false, $bXhtmlStyle); $APPLICATION->ShowCSS(true, $bXhtmlStyle); $APPLICATION->ShowHeadStrings(); $APPLICATION->ShowHeadScripts(); ?> |