简体   繁体   中英

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 hosting 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 eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM