mercredi 29 juillet 2015

Sub Domain implementation In MVC 5 Application

We are developing a MVC 5 application. Suppose the main site is like www.sport.com

Now we want to create 3 sub domain like cricket.sport.com, football.sport.com and hockey.sport.com

Most of the functionality will be same for this 3 sub-sites.

We have implemented 2 approaches :

Approach 1: Create 3 area for each cricket/football/hockey. But this will create code redundancy. So whenever request comes from URL we check and forward request to specific area.

Approach 2 : Create Single Controller - Check URL SubDomain and redirect depending upon each request and display specific view. In this approach, each time we need to check request sub domain and forward to same.

What is best possible way to implement sub domain in MVC application?

We want to deploy this site on Windows Azure.

Aucun commentaire:

Enregistrer un commentaire