1. В htaccess вставить редиректы:
# HTTPS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*?)(index\.php|$) https://prod.ru/$1 [R=301,L]
# WWW
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*?)(index\.php|$) https://prod.ru/$1 [R=301,L]
# Лишние /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{THE_REQUEST} ([^\s]*)\/{2,}(\?[^\s]*)?
RewriteRule ^(.*?)(index\.php|$) https://prod.ru/$1 [L,R=301]
# index.php с учетом страницы сравнения и get-параметров
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteCond %{QUERY_STRING} ^\z
RewriteCond %{REQUEST_FILENAME} !(\/compare.php)$
RewriteRule ^(.*?)(index\.php|$) http://dev.dsm.by/$1/ [R=301,L]
|
Важный нюанс - при переносе вписать домен прод-версии.
2.1 Schema website:
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "WebSite",
"name": "prod.ru",
"url": "https://prod.ru/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://prod.ru/?q={query}{search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
|
2.2 Schema organization:
<script type='application/ld+json'>
{
"@context": "http://www.schema.org",
"@type": "Organization",
"name": "Дискаунтер строительных материалов prod.ru",
"url": "https://prod.ru",
"address": {
"@type": "PostalAddress",
"streetAddress": "Минская область, Минский р-н, Папернянский с/с, 22",
"addressLocality": "аг. Большевик",
"addressCountry": "Беларусь"
},
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+375171111111"
}
}
</script>
|
2.3 Schema LocalBusiness:
<script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "LocalBusiness",
"name": "Дискаунтер строительных материалов dsm.by",
"image": "http://prod.ru/upload/CMax/423/rj0itth33ofjtox2wllp04eipmewtdgl.png",
"url": "https://prod.ru/",
"telephone": "+375171111111",
"address": {
"@type": "PostalAddress",
"streetAddress": "здание АБК",
"addressLocality": "аг. Большевик",
"postalCode": "223043",
"addressCountry": "Беларусь",
"addressRegion": " Папернянский с/с"
}
},
</script>
|
Устанавливается в футере, или файле /include/footer_include/bottom_footer_custom.php. В пункте target указать вместо q= другой поисковый параметр, если он менялся при настройке поиска.
2.4 Schema BreadcrumbList уже присутствует на Аспро Max.
Так же , как canonical на детальной карточке
2.5 Schems CollectionPage и Product для разделов
а. Кастомится шаблон каталога в папке /bitrix/templates/aspro_max/components/bitrix/catalog/
б. В файле /bitrix/templates/aspro_max/components/bitrix/catalog/main_c
в. Создается файл /include/schema-section.php
г. Создаются дубли отображений в /bitrix/templates/aspro_max/components/bitrix/catalog.section
д. Редактируется result_modifier и template в созданных папках.
3.1 Канонический url на всех страницах, кроме каталога:
<?
$catalog = strpos($APPLICATION->GetCurPage(true), 'catalog');
if($catalog === false){
$canonicalLine =str_replace('index.php', '', $APPLICATION->GetCurPage(true));
$APPLICATION->AddHeadString('<li nk rel="canonical" href="http://' . $_SERVER['HTTP_HOST'] . $canonicalLine . '" />');
};
?>
|
Прописывается в файле /bitrix/templates/aspro_max/header.php сразу после </head> . Исключение устанавливается для каталога. В некоторых магазинах также надо установить ограничение для бренда.
3.2 Канонический url на всех разделах каталога и фильтра:
Добавить код в конце component_epilog.php шаблонов, созданных комментом выше
$sectionRes = CIBlockSection::GetByID($arResult['ID']);
if($ar_res = $sectionRes->Fetch())
$sectionCode = $ar_res['CODE'];
$filter = strpos($APPLICATION->GetCurPage(true), 'apply');
$catalogSection = strpos($APPLICATION->GetCurPage(true), $sectionCode.'/');
if($filter !== false){
$canonicalLine = str_replace('index.php', '', $APPLICATION->GetCurPage(true));
$canonicalLine = substr($canonicalLine, 0, $catalogSection).$sectionCode.'/';
$APPLICATION->AddHeadString('<li nk rel="canonical" href="http://' . $_SERVER['HTTP_HOST'] . $canonicalLine . '" />');
} else {
$canonicalLine = str_replace('index.php', '', $APPLICATION->GetCurPage(true));
$APPLICATION->AddHeadString('<li nk rel="canonical" href="http://' . $_SERVER['HTTP_HOST'] . $canonicalLine . '" />');
}
|
Больше полезных материалов в нашем Telegram канале. Вступайте и будем на связи! https://t.me/bf_conversion

