Creating prefix.mysite.com

Hi:

I have a .Net Web Site - actually Learning Management System that I would like users to enter via a prefix - e.g.  apples.mysite.com, oranges.mysite.com.  Depending on how they come in, I would like to change the skin or theme of the website - something that I can readily do.  

What I am looking for is articles/best practices/suggestions on how to create the prefix.mysite.com in .Net 4.0 and as part of my web site.

Any help greatly appreciated.
RBSAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
One approach is to use themes, and CSS style pages, and set the Page.Theme in the Page_PreInit.

How to: Apply ASP.NET Themes Programmatically
http://msdn.microsoft.com/en-us/library/tx35bd89.aspx

If you have master pages, then you can centralize this approach.
0
qwe123kiddsCommented:
Hi

You may have to try url rewriting.. in Asp.net there loads of same of that on net//
0
MlandaTCommented:
The issue is in fact more about DNS than IIS. Do you have access to manipulating your DNS records for the site? To setup what you want, you would need to setup a wildcard DNS entry pointing to your website ip address.
*.example.com IN A 1.2.3.4

Open in new window

How you accomplish the DNS configuration will depend on who handles your DNS. If your DNS provider does not provide wildcard DNS entries you’ll want to find one who does.

Once you've done this, you can then use IIS Url Rewriting Rules to "rewrite" requests for abc.example.com to example.com/abc. So creating a subdomain becomes similar to simply creating a subfolder in your website and putting any necessary files into that subfolder. Alternatively, you could even rewrite that url out as "example.com/index.aspx?siteid=abc". Or even further virtualising that whole infrastructure as necessary. Just anything that suits your application model.

These articles may help:
http://www.seoconsultants.com/windows/isapi/subdomains/
http://thethoughtfulcoder.com/blog/8/IIS-7-URL-Rewrite-subdomains-and-host-headers
http://msmvps.com/blogs/bernard/archive/2005/03/22/39218.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RBSAuthor Commented:
thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.