I am currently working on upgrading an existing asp.net web application. It is being hosted on our local web server and I would like to direct users to a different page if they are connecting locally.
Example: An employee connecting on our local network would be directed to page A. If someone on an outside network connects (presumably a customer) they would be directed to page B. Is this possible? Does the web server know if the connection is local or not? If so, I should be able to code for it. Any help or suggestions would be appreciated.
We’ve had an embarrassingly awful hack in place for this kind of situation for years. And while I’m sure there’s a better way, what do do is look at the
System.Web.HttpContext.Current.Request.UserHostAddressand if it matches a list we go to one page, otherwise we go another.