Burak F. Kilicaslan
Burak F. Kilicaslan

Reputation: 535

Using a Domain as a SubDomain of a Different Site?

Here is the fantasy I want to create. Imagine my company is offering a Content Management System for companies who want to create their web sites easily. Company comes, selects package and theme and creates its web site from Category system to Product Details.

And the url of this company's web page is http://company.mysite.com

If he wants to login admin panel, the url is http://company.mysite.com/administrator

No problem till here. Everything is fine and working.. But I'd like give an option to the company whether he wants a new domain or not like Wordpress does. For example; www.mycompany.com is available and he wants it instead of mycompany.mysite.com

Here is the question;

How can I use this domain as if it was hosted on mysite.com? Briefly, I want to publish all data from one place and don't want to have duplicate files for every customer.

Note 1: Windows Server with IIS 7.5 Url Rewrite 2 is installed. Note 2: A hosting has to be opened for that company because they want to use e-mails like [email protected] also.

I really need an answer. I hope I could explain well. Hoping you to understand :)

At least please tell me the logic behind this.

Regards

Upvotes: 0

Views: 330

Answers (1)

David
David

Reputation: 34573

  1. You need to update the DNS entry for www.mycompany.com so that it points to the same webserver as company.mysite.com.
  2. Then in IIS if you have separate IIS web sites for each subdomain, you'll need to add www.mycompany.com as a new IIS binding to the company's IIS website.
  3. Now all traffic for both domains will be sent to the same .Net application so it is just up to your application to return the correct content.

Upvotes: 1

Related Questions