ASP.NET MVC creates subdomain URL in view

How to create subdomain url in view? For example, my application is on www.lol.com, which may change in the near future. I want to link Google applications located on a subdomain with email mail.lol.com.

How to do this, so I don’t need to hardcode the absolute URL?

+3
source share
2 answers

ASP.NET MVC is not going to handle this for you.

Fortunately, you are not the first to do something like this. Since you have full control over routing in .NET MVC, you just need to configure something for yourself.

- , www ( , www), Request.Headers["host"] .

- , , :

Hanssens.org | ASP.NET MVC Subdomain Routing

+2

Request.Headers["Host"], .

www., .

+2

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


All Articles