Y
Y
YouAreNext2018-11-16 01:31:25
Nginx
YouAreNext, 2018-11-16 01:31:25

Redirect non-www to www with subdomains?

There is a site with subdomains:
test1.example.ru
test2.example.ru
test3.example.ru
www.example.ru
example.ru
There is a config
server {
listen 443 ssl;
...
server_name example.ru www.example.ru test1.example.ru test2.example.ru test3.example.ru
}
How to make a redirect so that it does not affect subdomains. Only example.ru on www.example.ru

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Softer, 2018-11-16
@Softer

Take out example.ru. Something like this...

server
{
server_name example.ru;
listen 80;
listen 443 ssl;
rewrite *. https://www.example.ru$request_uri permanent;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question