[ACCEPTED]-Request.ServerVariables["SERVER_NAME"] is always localhost-asp.net

Accepted answer
Score: 13

Request.ServerVariables["HTTP_HOST"] gets 1 the value I was looking for :)

Score: 5

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

Score: 0

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?

Score: 0

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.

More Related questions