Stu Harper
Stu Harper

Reputation: 761

Host 2 seperate MVC websites under 1 url

I have 1 secure MVC website already hosted at say https://mysite.co.uk. This website has areas, controllers and actions as per normal:

https://mysite.co.uk/kitchen/create

https://mysite.co.uk/bathroom/edit

etc

Initially, I was told that my second MVC website would be able to be hosted under a new url: https://mysite-newsite.co.uk, so I have a new solution with.
But now unfortunately the deployment team have said it needs to be deployed under the initial main url:

https://mysite.co.uk/newsite

We are using iis7 and I have tried to achieve this using Add Application , but I just run into lots of problems with routing, nhibernate dll conflicts etc.

Can this be actually be resolved somehow in iis7 please? Or will the second MVC solution need to be re-written somehow?

Thanks

Upvotes: 4

Views: 154

Answers (1)

Nick Butler
Nick Butler

Reputation: 24433

I think your best bet would be to create a sub-directory in the first application's deployed directory and put the second application there.

You can then set the sub-directory to be its own application in IIS and they will operate independently.

So, you will have url's like this:

https://mysite.co.uk/kitchen/create <-- first site

https://mysite.co.uk/[subdirectory]/controller/action <-- second site

The route urls in the second application should work, but you will need to check this.

Otherwise, you will have to merge the two applications into one solution.

Upvotes: 2

Related Questions