I
I
Ilya Saveliev2019-07-30 07:03:55
1C-Bitrix
Ilya Saveliev, 2019-07-30 07:03:55

Why does a 404 error appear in the detailed Bitrix?

Hello.
The situation is this. Site on 1C-Bitrix. Connected SSL certificate from Comodo. To get rid of duplicates and make an automatic redirect from www -> without www in htaccess, the following code was written:

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On

  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
  RewriteCond %{HTTP:SSL} !1
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
  RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

Until yesterday, the functionality worked perfectly, that is :
1. site.ru -> https://site.ru
2. www.site.ru -> https://site.ru
including news headings :
1. site.ru/news/tra-la-la -> https://site.ru/news/tra-la-la/
2. www.site.ru/news/tra-la-la -> https:// site.ru/news/tra-la-la/
Yesterday, when opening any news (detail page), there was first a 301 redirect: HTTP/1.1 301 Moved Permanently Location: https://site.ru/404.php , and then HTTP/ 1.1 404 Not Found
Nothing has changed on the site, other sites with exactly the same htaccess entries work as they should . I can not understand what is the reason for the appearance of a 404 error in the detailed one.
If you comment out these lines, then the detailed news is displayed:
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP:SSL} !1
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]

but as expected, there is no SSL redirect nor www.
The reason for this behavior? How to overcome this mess?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-07-30
@floydman-89

Here is for Bitrix.
https://klondike-studio.ru/standards/standartnyy-h... Install
it if it doesn't work then there is an error in the code.
or server settings,
what OS is used, Bitrix vm?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question