Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save r3code/635743139058cc176874cf89538753f8 to your computer and use it in GitHub Desktop.

Select an option

Save r3code/635743139058cc176874cf89538753f8 to your computer and use it in GitHub Desktop.
HostCMS 6: запрет индексации станиц с пейджингом начиная со второй для магазина и информационных систем
<?php //r3code::Не допускать индексации страниц 2,3 и т.д. где содержимое группы разделено на несколько страниц (SEO)
$objectPresent = is_object(Core_Page::instance()->object);
$objClassName = get_class(Core_Page::instance()->object);
$isPagedSource = ($objClassName == 'Shop_Controller_Show' || $objClassName == 'Informationsystem_Controller_Show');
$notFirstPage= Core_Page::instance()->object->page > 0; // // Первая страница - 0
if ( $objectPresent && $isPagedSource && $notFirstPage )
{
// Запретить индексацию страниц с url /page-N/, но разрешить обход для сбора ссылок
?> <meta name="robots" content="noindex, follow"><?php
echo PHP_EOL;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment