Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8206047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:31:14+00:00 2026-06-07T08:31:14+00:00

We have an MVC application that is accessed from two separate websites. The default

  • 0

We have an MVC application that is accessed from two separate websites. The default website is fine, however how can I setup the second site to startup in a specific Controller?

Our default site is www.mysite.com, and we’d like to add a second IIS site for the header www.subdomain.mysite.com that should take users to www.subdomain.mysite.com/controller

But how can I tell IIS to startup www.mysubdomain.mysite.com with the specific controller action mycontroller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:31:15+00:00Added an answer on June 7, 2026 at 8:31 am

    I ended up adding a value to my AppSettings in web.config, and adjusting the default route of the application based on that value.

    public static void RegisterRoutes(RouteCollection routes)
    {
        var defaultController = ConfigurationManager.AppSettings["DefaultController"];
    
        if (string.IsNullOrEmpty(defaultController))
            defaultController = "Home";
    
        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = defaultController, action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );
    
        ...
    }
    

    This allows me to host any number of IIS sites that can each start with a different controller in the application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC 3 application that works fine when running locally from visual
I have a spring mvc application that I have broken up into separate maven
i have a MVC application that works fine; but now i need to put
I have a MVC application that reads some data from a database and loads
The setup I have an MVC application that's making AJAX requests into my controller.
I have an ASPNET MVC application that works fine locally but when I deployed
I have an asp.net mvc application that works fine under visual studio but when
I have this ASP.NET MVC application that I now want to separate out the
I have an mvc application that I allow businesses to log in using https://storea.mydomain.com
I have an MVC application that is using MEF for the controllers, all working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.