问题
I followed this steps:
What I did is edit this file: C:\Windows\System32\drivers\etc\hosts
I added a line: 127.0.0.1 myfakesite.com
Then I went to the Facebook edit app page, specifically the "Web Site" setting and entered Site Url: http://myfakesite.com Domain: myfakesite.com
Instead of running IIS Express, I had to run full IIS and enable myfakesite.com as one of the bindings. Here is how you do it: 1) Launch Internet Information Services Manager 2) Navigate to the "Default Web Site" 3) Right click on that node and choose "Edit Bindings" 4) In the dialog that opens click Add 5) Enter myfakesite.com in "Host Name" and click OK
Why do I get?
PS: I was trying to follow this tutorial, but I wanted to use IIS 7 not express.
回答1:
After editing hosts
file, Go to IIS manager!
in left panel go to SITES
,right click on it, and click Add web site
(pic below)
http://up.vatandownload.com/images/1lchjhpzufkst5uljq.png
in new window fill all fields: http://up.vatandownload.com/images/hghvinst528tkww6svyf.png
in picture I created new website test.hkh.com
!
site name: a name just for your web site. it can be anything
physical Path: a folder on your hard disk
IP address: can be left with default
host name: the address you enter in address bar of your browser
ok! now you have new site running!
Edit:If you want to add www.test.hkh.com to your server, there is no need to create new website! Just click on name of your site in left panel, then in right panel, click on Bindings
, in this window click Add
in host name
enter: www.test.hkh.com
!
Click on Ok
!
来源:https://stackoverflow.com/questions/7049473/use-myfakesite-com-instead-of-localhost-in-iis-7