Get Domain Name From Url Aspnet. We cannot go and hardcode it in the application as it may change based on the environment on which the application is running. There are a lot of options almost too many but I find the ones discussed here to be simple enough to get the job done.
Public SomeClass IHttpContextAccessor contextAccessor _contextAccessor contextAccessor. Clicking on the padlock icon and take a look at the certificate being used. A URL is a specific type of Uniform Resource Identifier URI although many people use the two terms interchangeably.
There are a lot of options almost too many but I find the ones discussed here to be simple enough to get the job done.
There are a lot of options almost too many but I find the ones discussed here to be simple enough to get the job done. If splitHostNameLength 2 var secondLevelHostName splitHostNamesplitHostNameLength - 2. In AspNet Core 31 if you want to get a full domain here is what you need to do. RequestUrlScheme gives output as httpshttp while requestUrlAuthority give us Domain name var baseUrl requestUrlScheme requestUrlAuthority.