2

I have a scenario very particular in a project... and I don't know what is the best way to get it work. To set in context, imaging we are programming a TODO Web App in ASP.NET MVC 6 (ASP.NET 5) and hosting in Azure like "Application Web".

We are going to have two sites:

Firs Site: www.mytododomain.com

This website is just for a landing page (marketing typical), but it need to have a register and login page. When the user make login or register, he is redirect to the next website.

Second Site: app.mytododomain.com

This place is when you create your TODO things, you can create, edit, delete, register, login and logoff. And the most important, you can share your TODO lists.

When you share a TODO lists, I need to share a link with the world like this:

mytododomain.com/share/{guid}

Relevant technical information:

  • I'm using Identity 3.0.
  • I am using cooking authentication and sharing the cookie between the subdomain and domain (this will be another goal!!).
  • I need to have two different web projects in my solution and deploy them on two differents Azure Application Web

The reason of that:

We want to have differents code, and different project, because if we deploy a new version of the main www.mytododomain.con web, we wont want to deploy the code app.mytodomain.com

What is the best way to do that?

Thank you so much!!

chemitaxis
  • 13,889
  • 17
  • 74
  • 125
  • 1
    Check this question, may resolve part of your question using custom routing: http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain# – jmservera Jan 15 '16 at 13:10

1 Answers1

1

I'm going to assume you are using IIS since you are using .Net.

If your domain and subdomain are going to point to different applications in IIS, then you should definitely have two different applications in your codebase. What I mean by this is that you should have two completely different solutions as these are two different applications.

If you need to share components between the two applications I recommend using a package manager to do so such as NuGet. This will allow you to have two decoupled applications making deployment of one not dependent on changes in the other.

As far as IIS is concerned, you can use IIS Bindings to have users of www.mytododomain.com go to one IIS hosted application and users of app.mytodomain.com go to another.

Always Learning
  • 2,623
  • 3
  • 20
  • 39