Answer the question
In order to leave comments, you need to log in
How to make a redirect from a subdomain to the main domain?
Hello.
There is a main domain https://topligarun.ru/ on Bitrix. the sales regions module is installed.
There are many subdomains by city.
The task is to make a redirect to the main domain from some cities.
For example, https://anapa.topligarun.ru/ etc.
Tell me where to do it in nginx or apache, and how to do it right?
I've tried it here and there, it doesn't work.
Answer the question
In order to leave comments, you need to log in
server {
listen 80;
server_name anapa.topligarun.ru msk.topligarun.ru spb.topligarun.ru;
return 301 http://topligarun.ru$request_uri;
}
server {
listen 80;
server_name topligarun.ru
#тут основной конфиг
}
if ($host != topligarun.ru )
{return 301 https://topligarun.ru$request_uri;}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question