.htaccess переход на https

Выполнил переход на https, сайт открывается по https, но и по http тоже. Может кто по коду в .htaccess подсказать, какой вариант редиректа надо прописать? И можно ли удалить все строки с направлением на http (ранее было прописано, но для чего не понял)?
# MODX supports Friendly URLs via this .htaccess file. You must serve web
# pages via Apache with mod_rewrite to use this functionality, and you must
# change the file name from ht.access to .htaccess.
#
# Make sure RewriteBase points to the directory where you installed MODX.
# E.g., "/modx" if your installation is in a "modx" subdirectory.
#
# You may choose to make your URLs non-case-sensitive by adding a NC directive
# to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

RewriteEngine On
RewriteBase /


# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]


# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} !^$
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTP_HOST} (.+)$
#RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L] 


RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]

# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
# https://www.domain.com when your cert only allows https://secure.domain.com
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
#RewriteRule ^du.php$ https://izmeritel.by/products/avtotraktornaya-elektronika/sistema-upravleniya-navesnyimi-ustrojstvami-mobilnyix-mashin/datchik-usilia-du-03-60.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
#RewriteRule ^du.php$ https://izmeritel.by/products/avtotraktornaya-elektronika/sistema-upravleniya-navesnyimi-ustrojstvami-mobilnyix-mashin/datchik-usilia-du-03-60.html? [R=301,L]


RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^service.php$ http://izmeritel.org? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^service.php$ http://izmeritel.org? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^name=price_sirius$ http://izmeritel.by/products/izdelia-avtomatiki-i-telemechaniki/programmno-texnicheskie-sredstva-pts-%C2%ABsirius%C2%BB.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^name=price_sirius$ http://izmeritel.by/en/products/izdelia-avtomatiki-i-telemechaniki/programmno-texnicheskie-sredstva-pts-%C2%ABsirius%C2%BB.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^view_mebel.php$ http://izmeritel.by/products/mebelnaya-furnitura-i-mexanizmyi-transformaczii? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^view_mebel.php$ http://izmeritel.by/en/products/mebelnaya-furnitura-i-mexanizmyi-transformaczii? [R=301,L]
 
RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^rele.php$ http://izmeritel.by/products/avtotraktornaya-elektronika/preryivateli-ukazatelej-povorot/preryivatel-ukazatelej-povorota-erp.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^rele.php$ http://izmeritel.by/en/products/avtotraktornaya-elektronika/preryivateli-ukazatelej-povorot/preryivatel-ukazatelej-povorota-erp.html? [R=301,L]
 
RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^view_mebel.php$ http://izmeritel.by/products/mebelnaya-furnitura-i-mexanizmyi-transformaczii? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^view_mebel.php$ http://izmeritel.by/en/products/mebelnaya-furnitura-i-mexanizmyi-transformaczii? [R=301,L]
 
 RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^yaschik.php$ http://izmeritel.by/products/izdeliya-iz-plastmass/yashhik-plastmassovyij-dlya-ovoshhej-i-fruktov.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^yaschik.php$ http://izmeritel.by/en/products/izdeliya-iz-plastmass/yashhik-plastmassovyij-dlya-ovoshhej-i-fruktov.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^dp.php$ http://izmeritel.by/products/avtotraktornaya-elektronika/sistema-upravleniya-navesnyimi-ustrojstvami-mobilnyix-mashin/beskontaktnyi-datchik-polozhenia-dp-01.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^dp.php$ http://izmeritel.by/en/products/avtotraktornaya-elektronika/sistema-upravleniya-navesnyimi-ustrojstvami-mobilnyix-mashin/beskontaktnyi-datchik-polozhenia-dp-01.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^kdu.php$ http://izmeritel.by/products/izdelia-avtomatiki-i-telemechaniki/kontroller-doziruyushhego-ustrojstva.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^kdu.php$ http://izmeritel.by/products/izdelia-avtomatiki-i-telemechaniki/kontroller-doziruyushhego-ustrojstva.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^pedal.php$ http://izmeritel.by/products/avtotraktornaya-elektronika/sensoryi-ruchnogo-upravleniya.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^pedal.php$ http://izmeritel.by/en/products/avtotraktornaya-elektronika/sensoryi-ruchnogo-upravleniya.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^sirius.php$ http://izmeritel.by/products/izdelia-avtomatiki-i-telemechaniki/programmno-texnicheskie-sredstva-pts-%C2%ABsirius%C2%BB.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^sirius.php$ http://izmeritel.by/en/products/izdelia-avtomatiki-i-telemechaniki/programmno-texnicheskie-sredstva-pts-%C2%ABsirius%C2%BB.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^sushilka.php$ http://izmeritel.by/articles/obzor-mobilnaya-zernosushilka-mr-300-k.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^sensor.php$ http://izmeritel.by/products/avtotraktornaya-elektronika/elektronnyie-pedali.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^sensor.php$ http://izmeritel.by/en/products/avtotraktornaya-elektronika/elektronnyie-pedali.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^about.php$ http://izmeritel.by/about.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^about.php$ http://izmeritel.by/en/about-the-enterprise.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^finans.php$ http://izmeritel.by/finans.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^finans.php$ http://izmeritel.by/en/finans.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^contacts.php$ http://izmeritel.by/contacts.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^contacts.php$ http://izmeritel.by/en/contacts.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^prices.php$ http://izmeritel.by/products? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^catalog.php$ http://izmeritel.by/products? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^prices.php$ http://izmeritel.by/en/products? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^catalog.php$ http://izmeritel.by/en/products? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^news.php$ http://izmeritel.by/news? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^news.php$ http://izmeritel.by/en/news? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^Arenda.php$ http://izmeritel.by/services/arenda-pomeshhenij.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^Arenda.php$ http://izmeritel.by/en/services/arenda-pomeshhenij.html? [R=301,L]

RewriteRule ^tax\.php$ / [R=301,L] 
RewriteRule ^pn\.php$ /products/avtotraktornaya-elektronika/preobrazovateli-napryazheniya.html  [R=301,L]  
RewriteRule ^kdu\.php$ /products/izdelia-avtomatiki-i-telemechaniki/kontroller-doziruyushhego-ustrojstva.html [R=301,L] 
 

RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^capital.php$ http://izmeritel.by/services/prodazha-nedvizhimogo-imushhestva.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^index.php$ http://izmeritel.by/en? [R=301,L]




RewriteCond %{QUERY_STRING} ^lng=ru
RewriteRule ^$ http://izmeritel.by/? [R=301,L]
RewriteCond %{QUERY_STRING} ^lng=en
RewriteRule ^$ http://izmeritel.by/en/? [R=301,L]
Стас
07 октября 2022, 08:57
modx.pro
403
-1

Комментарии: 3

Роман
07 октября 2022, 10:21
+1
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^izmeritel\.by [NC]
RewriteRule (.*) https://izmeritel.by/$1 [R=301,L]
Попробуйте удалите, только если у вас есть доступ к ftp сайта.
    Стас
    07 октября 2022, 10:34
    0
    Это нужно прописать вместо
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    или дополнительно после
    RewriteEngine On
    RewriteBase /
      Роман
      07 октября 2022, 12:21
      +1
      Дополнительно после.
      Тут тоже нужно поправить на https:
      RewriteCond %{HTTP_HOST} .
      RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
      RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
    Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
    3