I want to create many virtual subdomains e.g my original site is www.Test.com but I want that my site users can open my site with the given pattern username.Test.com
Can you please help me for this issue?
migrated from stackoverflow.com Sep 16 '11 at 12:45
This question came from our site for professional and enthusiast programmers.
There will be a couple of things that you need to do in this situation. First, you will need to create a wildcard DNS entry. Most DNS server software will allow you to create an
Second, you will need to configure your web server (I'll presume IIS since you tagged the question with asp.net) with a binding to the same IP address specified in the DNS record. Do not specify a hostname on this binding. This will cause IIS to catch any request for that IP address which isn't specifically bound to another website entry by its IP/name combination (again, you can have a site bound to the same IP with specific hostnames which will override this one).
Next, in your application code, you will need to handle the incoming request by looking at the variables coming from the server, specifically the