Answer the question
In order to leave comments, you need to log in
How to set a redirect correctly?
Tell me how to set up redirects,
Main site
https://www.site.ru
Accordingly, I need from www to without www
and from http to https
in htaccess
RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}/ [R=301,L]
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^site\.ru
RewriteRule ^(.*)$ https://www.site.ru/$1 [R=permanent,L]
RewriteCond %{HTTP_HOST} ^www.site.ru\.index\.php?module=MainView&page_url=
RewriteRule ^(.*)$ https://www.site.ru/ [R=permanent,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^сайт\.ru$ [NC]
RewriteRule ^(.*)$ https://www.сайт.ru/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question