سؤال

I know that there is a way to make any defined URL resolve to a different URL, but I can't remember how or where to define this setting.

I understand this is ambiguous, so consider the following example. I am building http://www.webapplication.com. I have set up the web site in IIS 7. However, I haven't forwarded the nameservers to resolve my server yet, so the URL points to somewhere else completely. However, when I access http://www.webapplication.com locally, I would like the IIS 7 website to be resolved.

How can I do this? Is this a setting in IIS, the individual browser (IE or Chrome) or somewhere else (like my network settings)?

هل كانت مفيدة؟

المحلول

One way to do this would be using your HOSTS file. You would want to edit it to add an entry for your domain name that maps to the IP address of the server.

Here's a blog post describing the steps involved.

نصائح أخرى

+1 to optus for the blog post on how to do this. Just so the instructions are not lost if the blog post that optus mentions goes away, here is what you need to do:

  1. Browse to Start -> All Programs -> Accessories
  2. Right click "Notepad" and select "Run as administrator"
  3. Click "Continue" on the UAC prompt
  4. Click File -> Open
  5. Browse to "C:\Windows\System32\Drivers\etc"
  6. Change the file filter drop down box from "Text Documents (.txt)" to "All Files (.*)"
  7. Select "hosts" and click "Open"
  8. Make the needed changes and close Notepad. Save when prompted.
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top