Answer the question
In order to leave comments, you need to log in
Does an https subdomain redirect to the main site?
There is a VPS, where the site is running on Apache.
There was such a dilemma.
there is a subdomain dev.site.ru - where, as a rule, I make it up and then transfer it to the main one.
The main site looks like this https://www.site.ru (everything is redirected to it by these directives in Apache
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