16

Is it possible ti create a web site in IIS7 which somehow could look like it sits in a different domain, so that from one of this site's pages I can test Cross-Origin-Resource-Sharing calls to a WCF service in my local host?

pencilCake
  • 51,323
  • 85
  • 226
  • 363

2 Answers2

11

You can add any domain names you like to your hosts file (%windir%\System32\Drivers\etc\hosts) and map those back to 127.0.0.1. Any requests to that domain will then be sent to your local machine.

Each domain name you add should be treated separately so far as CORS is concerned. If you're on a Windows Server SKU, you can even configure IIS to use multiple sites and configure it to examine host headers to determine which site responds to requests for each domain.

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
4

You can modify your hosts file in C:\windows\system32\drivers\etc\

Add an entry like:

127.0.0.1    your domain name

Then in iis add a host name on your website for "your domain name"

Matt Whetton
  • 6,616
  • 5
  • 36
  • 57