Answer the question
In order to leave comments, you need to log in
How to fix the search after changing the CNC and exclusion from the url /catalog/?
Hello!
Rewriting the site from scratch.
For SEO, it is important that the urls remain the same as before.
By default, in Bitrix, a link to a section looks like this: {domain}/catalog/{section}/, but I need to bring it to the form {domain}/{section}/. Implemented. Registered SEF_FOLDER "/" But now the search has stopped working, since it refers to the catalog component.
A solution was suggested earlier in the catalog/index.php file.
<?if(CSite::InDir('/catalog/index.php')):?>
// here will call a simple component from the sections.php file of the catalog component
<?else:?>
// here is your catalog component
<? endif;?>
However, I am not an avid programmer and cannot understand where exactly what to prescribe. In the comment, the contents of the catalog/Index.php file. Explain to a simple person how to fix it?
Answer the question
In order to leave comments, you need to log in
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetPageProperty("HIDE_LEFT_BLOCK", "Y");
$APPLICATION->SetPageProperty("MENU_SHOW_SECTIONS", "N");
$APPLICATION->SetPageProperty("VIEWED_SHOW", "N");
$APPLICATION->SetTitle("Directory");
$APPLICATION->IncludeComponent(
"bitrix:catalog",
"main",
array(
"IBLOCK_TYPE" => "aspro_max_catalog",
"IBLOCK_ID" => "384",
"HIDE_NOT_AVAILABLE" => "N",
"BASKET_URL" => "/basket/",
"ACTION_VARIABLE" =>
"PRODUCT_PROPS_VARIABLE" => "prop",
"SEF_MODE" => "Y",
"SEF_FOLDER" => "/",
....
"DETAIL_IMAGE_RESOLUTION" => "16by9",
"DETAIL_PRODUCT_INFO_BLOCK_ORDER" => "sku,props" ,
"DETAIL_PRODUCT_PAY_BLOCK_ORDER" => "rating,price,priceRanges,quantityLimit,quantity,buttons",
"DETAIL_BLOCKS_ORDER" => "complect,nabor,offers,tabs,services,news,blog,staff,vacancy,gifts,goods",
" DETAIL_SHOW_SLIDER" => "N",
"DETAIL_DETAIL_PICTURE_MODE" => array(
0 => "POPUP",
1 => "MAGNIFIER",
),
"DETAIL_DISPLAY_PREVIEW_TEXT_MODE" => "E",
"MESS_PRICE_RANGES_TITLE" => "Prices",
"MESS_DESCRIPTION_TAB" => "Description",
"MESS_PROPERTIES_TAB" => "Features",
"MESS_COMMENTS_TAB" => "Comments",
"LAZY_LOAD" => "N",
"LOAD_ON_SCROLL" => "N",
"USE_ENHANCED_ECOMMERCE" => "N",
"DETAIL_DOCS_PROP" => "-",
"STIKERS_PROP" => "-",
"USE_SHARE" => "Y",
"TAB_OFFERS_NAME" => "",
"TAB_DESCR_NAME" => "",
"TAB_KOMPLECT_NAME" => "",
"TAB_NABOR_NAME" => "",
"TAB_CHAR_NAME" => "",
"TAB_VIDEO_NAME" => "",
"TAB_REVIEW_NAME" => "",
"TAB_FAQ_NAME" => "",
"TAB_STOCK_NAME" => "",
"TAB_DOPS_NAME" => "",
"BLOCK_SERVICES_NAME" => "",
"BLOCK_DOCS_NAME" => "",
"DIR_PARAMS" => CMax::GetDirMenuParameters(__DIR__ ),
"ELEMENT_DETAIL_TYPE_VIEW" => "FROM_MODULE",FROM_MODULE",FROM_MODULE",
"SHOW_CHEAPER_FORM" => "N",
"LANDING_TITLE" => "Popular Categories",
"LANDING_SECTION_COUNT" => "10",
"LANDING_SEARCH_TITLE" => "Related Searches",
"LANDING_SEARCH_COUNT" => "7",
"LIST_SECTIONS_TYPE_VIEW" => "sections_1",
"LIST_ELEMENTS_TYPE_VIEW" => "list_elements_1",
"CHEAPER_FORM_NAME" => "",
"SECTIONS_TYPE_VIEW" => "FROM_MODULE",
"SECTION_ELEMENTS_TYPE_VIEW" => "list_elements_1",
"ELEMENT_TYPE_VIEW" => "FROM_MODULE",
"LANDING_TYPE_VIEW" => "FROM_MODULE",
"FILE_404" => "",
"SHOW_MEASURE_WITH_RATIO" => "N",
"SHOW_COUNTER_LIST" => "N",
"SHOW_DISCOUNT_TIME_EACH_SKU" => "N",
"USER_CONSENT" => "N",
"USER_CONSENT_ID" => "0",
"USER_CONSENT_IS_CHECKED" => "Y",
"USER_CONSENT_IS_LOADED" => "N",
"SHOW_ARTICLE_SKU" => "Y",
"USE_FILTER_PRICE" => "N",
"DISPLAY_ELEMENT_COUNT" => "Y",
"RESTART" => "Y",
"USE_LANGUAGE_GUESS" => "Y",
"NO_WORD_LOGIC" => "Y",
"SORT_REGION_PRICE" => "Bitrix - Standard Client Agreement",
"SHOW_SECTION_DESC" => "Y",
"USE_ADDITIONAL_GALLERY" => "Y",
"ADDITIONAL_GALLERY_TYPE" => "BIG",
"ADDITIONAL_GALLERY_PROPERTY_CODE" => "-",
"ADDITIONAL_GALLERY_OFFERS_PROPERTY_CODE" => "-",
"BLOCK_ADDITIONAL_GALLERY_NAME" => "",
"STORES_FILTER" => "TITLE",
"STORES_FILTER_ORDER" => "SORT_ASC",
"VIEW_BLOCK_TYPE" => "N",
"SHOW_HOW_BUY" => "Y",
"TITLE_HOW_BUY" => "How to Buy",
"SHOW_DELIVERY" => "Y",
"TITLE_DELIVERY" => "Delivery",
"SHOW_PAYMENT" = > "Y",
"TITLE_PAYMENT" => "Payment",
"SHOW_GARANTY" => "Y",
"TITLE_GARANTY" => "Guarantee terms",
"TITLE_SLIDER" => "Recommended",
"SHOW_SEND_GIFT" => "N" ,
"SEND_GIFT_FORM_NAME" => "",
"BLOCK_LANDINGS_NAME" => "",
"BLOG_IBLOCK_ID" =>"357",
"BLOCK_BLOG_NAME" => "",
"RECOMEND_COUNT" => "5",
"VISIBLE_PROP_COUNT" => "6",
"BIGDATA_EXT" => "bigdata_1",
"SHOW_DISCOUNT_PERCENT_NUMBER" => "N",
"ALT_TITLE_GET " => "SEO",
"BUNDLE_ITEMS_COUNT" => "3",
"SHOW_LANDINGS_SEARCH" => "Y",
"SHOW_LANDINGS" => "N",
"LANDING_POSITION" => "BEFORE_PRODUCTS",
"USE_DETAIL_PREDICTION" => "Y",
"SECTION_BG" => "-",
"OFFER_SHOW_PREVIEW_PICTURE_PROPS" => array(
),
"LANDING_IBLOCK_ID" => "369",
"DETAIL_BLOCKS_TAB_ORDER" => "desc,char,stores,video,reviews,buy,payment,delivery,custom_tab",
"DETAIL_BLOCKS_ALL_ORDER" => "complect,goods,set,offers,desc,char,buy,payment,delivery,video,stores,custom_tab,services,news,blog,reviews,staff,vacancy,gifts",
"DELIVERY_CALC" => "Y",
"DELIVERY_CALC_NAME" => "",
"ASK_TAB" => "",
"TAB_NEWS_NAME" => "",
"TAB_STAFF_NAME" => "",
"TAB_VACANCY_NAME" => "",
"STAFF_VIEW_TYPE" => "staff_block",
"SECTION_TYPE_VIEW" => "FROM_MODULE",
"SHOW_BUY_DELIVERY" => "Y",
"TITLE_BUY_DELIVERY" => "Payment and Delivery",
"BLOG_URL" = > "catalog_comments",
"LANDING_SEARCH_COUNT_MOBILE" => "3",
"USE_BIG_DATA_IN_SEARCH" => "Y",
"SHOW_MORE_SUBSECTIONS" => "Y",
"SHOW_SIDE_BLOCK_LAST_LEVEL" => "Y",
"SHOW_SORT_IN_FILTER" => "Y",
"SUBSECTION_PREVIEW_PROPERTY" => "DESCRIPTION",
"SHOW_SUBSECTION_DESC" => "Y",
"LANDING_SECTION_COUNT_MOBILE" => "3",
"SHOW_SMARTSEO_TAGS" => "Y",
"SMARTSEO_TAGS_COUNT" => "10",
"SMARTSEO_TAGS_COUNT_MOBILE" => "3",
"SHOW_SKU_DESCRIPTION" => " N",
"USE_CUSTOM_RESIZE"
=
>
"
Y
" "N",
"MAX_IMAGE_SIZE" => "0.5",
"TAB_BUY_SERVICES_NAME" => "",
"COUNT_SERVICES_IN_ANNOUNCE" => "2",
"SHOW_ALL_SERVICES_IN_SLIDE" => "N",
"BIGDATA_SHOW_FROM_SECTION" => "N",
"BIG_DATA_IN_SEARCH_RCM_TYPE " => "bestselling",
"TITLE_SLIDER_IN_SEARCH" => "Recommended",
"RECOMEND_IN_SEARCH_COUNT" => "20",
"MODULES_ELEMENT_COUNT" => "10",
"DETAIL_SET_PRODUCT_TITLE" => "Build kit",
"DISPLAY_LINKED_PAGER" => "Y",
"SEF_URL_TEMPLATES" => array(
"sections" => "",
"section" => "#SECTION_CODE#/",
"element" => "#SECTION_CODE#/#ELEMENT_CODE#/ ",
"compare" => "compare.php/?action=#ACTION_CODE#",
"smart_filter" => "#SECTION_CODE#/filter/#SMART_FILTER_PATH#/apply/",
),
"VARIABLE_ALIASES" => array(
" compare" => array(
"ACTION_CODE" => "action",
),
)
),
false
);?><?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question