Uri host-based routing

So, the main premise of this problem is that I have one hosted web space that comes with two domain names. I'm not sure how to configure routing in asp.net mvc, so the first thing I would check would be this host in the request object so that I can have more user traffic to two separate parts of my site.

For example:

http://www.mywebsite1.com/products/14

http://www.mywebsite2.com/products/14

How do you route so that these two URLs end in returning two different pages based on the host context used in the request?

Thanks in advance!

+3
source share
2 answers

, - URL .

: Asp.Net

+1

- URL- IIS7 , , . , , URL-, :

http//www.example1.org/-/1 → http//www.example1.org/example1/Something/1 http//www.example2.org/-/1 → http//www.example2.org/example2/Something/1

URL, - .

+1

Source: https://habr.com/ru/post/1706206/


All Articles