0

I have an ASP.NET application (WebForms) A which serves mycompany.com URL.

I need to host new website (ASP.NET MVC) B on the same IIS, which serves mycompany.com/B/... pattern.

Main objective here is that, we want to keep mycompany.com domain in URL for branding issues.

How can I manage this?

The scenarios I already tried:

  • I defined mycompany.com/B pattern on load balancer, so that balancer can redirect specific request to my website B. In this scenario, webpage load was successful however resource files such as css, js, etc failed to load because they tried to load from mycompany.com insted of mycompany.com/B.

1 Answer 1

1

You can configure B as a virtual directory in A. In IIS manager, right-click on A, choose "Add application.." and configure B from the dialog you get.

Then, the B application will know that it is not a root application, and all helper methods in MVC that generate URLs will add the correct prefix (for example, Url.Action or will give you a url starting with /B/). With methods that take a URL as parameter (like Url.Content), you'll need to use a virtual URL, starting with ~/.

Sign up to request clarification or add additional context in comments.

1 Comment

Riokmij, thanks for your reply but we do not want to create virtual directories. We want to add new website on IIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.