Created
August 27, 2017 19:55
-
-
Save r3code/635743139058cc176874cf89538753f8 to your computer and use it in GitHub Desktop.
HostCMS 6: запрет индексации станиц с пейджингом начиная со второй для магазина и информационных систем
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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