views:

262

answers:

2

I am trying to set up a subdomain on my website but i am having a hard time getting it to work. Especially since the only way i can test it is by sending all the files needed from my development machine to the hosting server (and sometimes breaking the website). i am using asp.net on an IIS7 servers

Is there an easy way to do the setting on the development machine?

+2  A: 

what did you mean by simulate? You can easily add a subdomain in your host file

\system32\drivers\etc\hosts

Just make sure that you have a dns entry for this new domain. So contact whoever is incharge of creating them.

Hope this helps.

CodeToGlory
+7  A: 

One thing you can do is to edit your "<windows directory>\system32\drivers\etc\hosts" file, and point the domain name to 127.0.0.1.

Do this by adding a line at the bottom of the file:

127.0.0.1    subdomain.testdomain.com

The question was about ASP.NET and IIS, so I assumed Windows, but just in case anybody reads this that wants to know the Linux equivalent, you'll want to edit the file "/etc/hosts", and add a line of the same format.

Very important note: If you redirect the real domain name to your local machine like this, don't forget that you did it, or it'll drive you nuts later when you can't figure out why the changes you uploaded to the live site aren't doing anything. Not that I know from experience or anything.

Chad Birch
Thanks.. Learnt a new trick :) +1
Chathuranga Chandrasekara
awesome! i will try this right away!
zaladane
I guess you have to adjust your IIS settings to add your subdomain.testdomain.com virtual host.
SeasonedCoder
At work we tend to replace the TLD with the company name, that way we know its a loopback address ;)
TWith2Sugars