Y
Y
Yuriy2021-12-10 12:55:14
1C-Bitrix
Yuriy, 2021-12-10 12:55:14

Bitrix infinite redirect of the product card when the section is nested 4+?

https://site.ru/catalog/cat_1/cat_2/cat_3/cat_4/2631/

with such a product nesting, there is a permanent redirect, if you set the canonical address to a lower level for the product, then everything works.

htaccess - the redirect stops if modrewrite is disabled (but routing does not work, of course), all other rules in the file do not affect
disabling the component in /catalog/index.php does not give results
urlrewrite.php no rules for such links, only the main one for the directory

341 => 
  array (
    'CONDITION' => '#^/catalog/#',
    'RULE' => '',
    'ID' => 'bitrix:catalog',
    'PATH' => '/catalog/index.php',
    'SORT' => 100,
  ),


did anyone come across?

Options -Indexes 
ErrorDocument 404 /404.php

<IfModule mod_php5.c>
  php_flag session.use_trans_sid off
  #php_flag default_charset UTF-8
  #php_value display_errors 1
</IfModule>

<IfModule mod_php7.c>
  php_flag session.use_trans_sid off
  #php_flag default_charset UTF-8
  #php_value display_errors 1
   php_value memory_limit 4096M
   php_value max_execution_time 300
</IfModule>

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On

# 301 редирект на https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{REQUEST_URI} !^/bitrix/admin/1c_exchange\.php$ [NC] 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

############################################################################
#### Убираем index.php, если он есть в конце URL                        ####
############################################################################
RewriteCond %{REQUEST_URI} ^(.*)/index\.(php|html|htm)$
# URL cодержит index.php в конце.
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.

############################################################################
#### Убираем повторяющиеся слеши (/) в URL                              ####
############################################################################
RewriteCond %{THE_REQUEST} //
# Проверяем, повторяется ли слеш (//) более двух раз.
RewriteCond %{QUERY_STRING} !http(s|)://
# Убедимся что это не урл в  GET
RewriteRule .* /$0 [R=301,L]
# Исключаем все лишние слеши.

RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ https://%1/$1 [L,R=301] 

############################################################################
#### Добавляем слеш(/), если его нет, и это не файл.                    ####
############################################################################
RewriteCond %{REQUEST_URI} !(.*)/$
# Если слеша в конце нет.
RewriteCond %{REQUEST_FILENAME} !-f
# Не является файлом.
RewriteCond %{REQUEST_URI} !\..+$
# В URL нет точки (файл).
RewriteCond %{REQUEST_URI} ^(.+)$
# В URL есть хоть один символы
RewriteRule ^(.*)$ %1/ [L,R=301]
# Добавляем слеш в конце.
    
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
  #Header set Access-Control-Allow-Origin "*"
  RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>

#<IfModule mod_headers.c>
#   Header set Access-Control-Allow-Origin "*"
#   Header set Access-Control-Allow-Headers "Content-Type"
#   Header set Access-Control-Allow-Methods "GET, PUT, OPTIONS, DELETE, POST"
#</IfModule>

############################################################################
#### Компрессия статического контента для гугл  спид тест               ####
############################################################################
<IfModule mod_deflate.c>
  AddType image/svg+xml .svg
  AddOutputFilterByType DEFLATE image/svg+xml  
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
<IfModule mod_expires.c>
  ExpiresActive on
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/svg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType text/javascript "access plus 1 year"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
  ExpiresByType application/x-font-ttf "access plus 1 year"
  ExpiresByType application/x-font-opentype "access plus 1 year"
  ExpiresByType application/x-font-woff "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>

  #Header set Access-Control-Allow-Origin "https://analytics.bitrix.info"
  Header add Access-Control-Allow-Methods "GET, POST"

  <filesmatch "\.(ico|flv|jpg|jpeg|webp|png|gif|css|swf)$">
  	Header set Cache-Control "max-age=31536000, public"
  </filesmatch>
  <filesmatch "\.(html|htm)$">
  	Header set Cache-Control "max-age=7200, private, must-revalidate"
  </filesmatch>
  <filesmatch "\.(pdf)$">
  	Header set Cache-Control "max-age=86400, public"
  </filesmatch>
  <filesmatch "\.(js|otf|ttf|woff|woff2)$">
  	Header set Cache-Control "max-age=31536000, private"
  </filesmatch>

</IfModule>
############################################################################
#### Конец общей части, далее следует собственные директивы .htaccess   ####
############################################################################

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question