user355562
user355562

Reputation: 3373

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!

Upvotes: 3

Views: 1461

Answers (3)

Damien Dennehy
Damien Dennehy

Reputation: 4064

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

Upvotes: 0

John Sheehan
John Sheehan

Reputation: 78104

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 :)

Upvotes: 2

Aristos
Aristos

Reputation: 66641

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

Upvotes: 4

Related Questions