K
K
Ksander882020-06-21 18:51:47
WordPress
Ksander88, 2020-06-21 18:51:47

How to redirect by IP on subdomains?

Hello, we have a main site for St. Petersburg, we have deployed a multisite and a subdomain for Moscow of the form: msk.sait.ru, the question is how to automatically redirect visitors from St. Petersburg to the main IP, visitors from Moscow to the subdomain? Thanks for all the replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ermilov, 2020-06-23
@sergeiermilov

This is a serious task. For each city, not one IP, but a lot, there are many IP directories.
There are 4.22 billion IPv4 addresses in total. They are divided between countries. Within countries between Internet operators. The latter, in turn, distribute them among the cities of presence. And then redistributed as needed.
There are special registries where this very distribution is fixed.
You need to start with this article on Habré for understanding. Then it’s up to you to solve the problem with the technique of solving the problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question