W
W
WebforSelf2022-04-08 17:20:42
Apache HTTP Server
WebforSelf, 2022-04-08 17:20:42

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]


Accordingly, the site
dev.site.ru - a separate config has been created, and if you go via http, then the site is available just a test one,
but if you go via
https:/dev.site.ru or https:/www.dev.site.ru
or dev.site.ru , then for some reason the main site opens.

It turns out that my test is available only at
http:/dev.site.ru

It's strange, who came across it? how to treat?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexVWill, 2022-04-08
@AlexVWill

How strange, who faced? how to treat?

And to show configs - not destiny? ;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question