Answer the question
In order to leave comments, you need to log in
Redirecting https to non-WWW and http to www?
There is a rule in htaccess
RewriteCond %{HTTP_HOST} ^site.ru
RewriteRule (.*) www.site.ru/$1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
thanks Victor Taran @shambler81
what's the problem then?
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT } !^443$
RewriteCond %{HTTP_HOST} !^www\.(.*) [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP} On
RewriteCond %{HTTP_HOST} ^site.ru
RewriteRule (.*) www.site.ru/$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question