Host Four ASP.Net Projects in IIS as single direcory(maintain more projects in same url)

58 views Asked by At

I m having a ASP.Net Webapplication it accessed by from many geography like India,China&America.In that application's login page fields are username,Password & Geography. Based on this login page geography option the application's functionalities will change in all page.

In this project,If we add a feature for Indian users but that will not required for other geography users,So we use some conditions like if The geography is India means Enable the feature others means disable it. problem here it is, in all pages we need to use so many conditions check,some time it creates conditions check overhead.

So we planing for divide the webappplication in to separate applications based on geography wise.

What I planing is, In hosting environment
1.Keep the same project into Three(India,China,America) Subdirectories.
2.In root directory we have login page only .So once user select the geography means we need to redirect the corresponding subdirectory.

By this way we can maintain the changes which made based geography as separate.

But My doubt is...

If we keep the project as Three(India,China,America) Subdirectories means each directories are have same files ,bin and webconfig file,So I think we cant maintain more than one webconfig file in hosted ASP.Net application folder.

This Subdirectories idea is possible or not in IIS hosting environment?
Is any other options are available?

Experts please share your valuable ideas.

Thanks in Advance
Ramesh

1

There are 1 answers

1
Brian Gilreath On BEST ANSWER

Good afternoon Ramesh!

If I understand your question correctly you currently have 3 separate web roots and you want to use these as separate web applications that will be served to users based on geography in some way. You also want to maintain individual web configuration files for each as well. If this is your inquiry then this set-up is definitely possible within IIS 7 and above.

To provide this functionality this you can do the following:

  1. Configure a single main site within the IIS. This site can point to a web root or nothing. If it points to a web root, whatever web.config that exists will be inherited by the web applications we will add in the next few steps. Otherwise, the machine.config will be used.
  2. Add 3 separate web applications underneath this main site. Make sure to add the root path of each application to use the respective 3 paths for your web roots. The web applications will by default inherit web configurations from the main site as mentioned earlier, but you can include a separate web.config within each of these web root folders.