[ACCEPTED]-Request.ServerVariables["SERVER_NAME"] is always localhost-asp.net
Accepted answer
Request.ServerVariables["HTTP_HOST"] gets 1 the value I was looking for :)
Youre right You want to retrieve the full 3 address of the website that the request 2 came to. Do not use "SERVER_NAME", use 1 "HTTP_HOST". Read here, http://www.requestservervariables.com/get-address-for-website
Server_Name
returns the server's host name, DNS alias, or 2 IP address as it would appear in self-referencing 1 URLs
Why don't you use Request.URL
?
Your host files only redirect the requests 3 to a specific IP address - you cannot change 2 the requesting machines name by editing 1 them.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.