2 Replies - 22636 Views - Last Post: 14 January 2013 - 03:37 PM

#1 magius96   User is offline

  • D.I.C Addict
  • member icon

Reputation: 75
  • View blog
  • Posts: 834
  • Joined: 15-April 09

localhost addressing

Posted 14 January 2013 - 01:52 PM

I'm having an issue with our development server and I'm hoping someone can point me in the right direction.

When on any system other than the development server, we can point our web browsers to a url like http://dev.example.com and it pulls up the webpage for our development server.

When working on the development server the url gets us a server not found error and we have to use http://localhost instead.

The development server is a windows based system with IIS 7. What I'd like to do is setup something so that when I'm on the server, it will recognize the full address as being mapped to localhost, without interferring with how the url mapping is done off the server. Is this at all possible?

----EDIT----
All URLs have been changed in the interest of security.

This post has been edited by Atli: 14 January 2013 - 02:15 PM
Reason for edit:: Replaced your example URL with "example.com". Better to use that than some random URL.


Is This A Good Question/Topic? 0
  • +

Replies To: localhost addressing

#2 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: localhost addressing

Posted 14 January 2013 - 02:22 PM

Hey.

If you are just talking about redirecting things like http://dev.localhost/ to your local HTTP server, then you can do that by editing the hosts file for you system; the first place it looks to match domains to IP addresses, before it starts to query DNS records.

On Windows, just open Notepad in admin mode and open the file: C:\Windows\System32\drivers\etc\hosts. Then add lines to that file in this format:
ip-address    domain-name


Like:
127.0.0.1    localhost
127.0.0.1    dev.localhost
127.0.0.1    new-site.localhost



This will redirect requests from them to your local HTTP server. I don't have much experience with IIS, but on Apache you can easily set up virtual hosts to serve different files based on the domain. IIS should have something equivalent.
Was This Post Helpful? 1
  • +
  • -

#3 magius96   User is offline

  • D.I.C Addict
  • member icon

Reputation: 75
  • View blog
  • Posts: 834
  • Joined: 15-April 09

Re: localhost addressing

Posted 14 January 2013 - 03:37 PM

Thank you so very much. I had asked my manager if our IT department could fix the issue and I was told that I would just have to program around it. You're response has proven my manager incorrect, thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1