How to setup sub-domains in development environment - asp.net?
I would like to know the method of setting up sub-domains in the development environment. Don't have any hostin开发者_如何学运维g account yet. But would like to test it up internally by simulating a similar setup that would be provided by the hosting company later on.
Thanks!
Edit (with a notepad) the hosts file that is existing on
c:\WINDOWS\system32\drivers\etc\
to enter your test sites something like this
127.0.0.1 local.mysite.com
127.0.0.1 sub1.mysite.com
127.0.0.1 sub2.mysite.com
Open the C:\Windows\System32\Drivers\etc\hosts
file in Notepad (make sure you run Notepad as an Administrator) and add a bunch of entries like this:
127.0.0.1 test1.local
127.0.0.1 test2.local
127.0.0.1 test3.local
Save the file and load up your application using each test domain e.g. http://test1.local/ (or if you're using the VS development server, include the port number). You can use any names you want if you don't like my style :)
If you're using IIS on your development server to replicate your hosting company's conditions, be sure and set up Host Headers too.
http://technet.microsoft.com/en-us/library/cc753195%28WS.10%29.aspx
精彩评论