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 858875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:36:03+00:00 2026-05-15T08:36:03+00:00

I have an MVC website which has 3 main components Member area which has

  • 0

I have an MVC website which has 3 main components

  1. Member area which has the path /Member/{controller}/{action}/{id}
  2. Individual pages which will respond to any subdomain, e.g. user1.example.com/{controller}/{action}/{id}, user2.example.com/{controller}/{action}/{id}
  3. Main website which will respond to any url under http://www.example.com/{controller}/{action}/{id}

What is the easiest way to handle the routes that will allow the above 3 items to co-exist? I have tried many MapRoutes from the global.asax.cs file and also making a new class based on RouteBase but not having much luck.

  • 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-05-15T08:36:04+00:00Added an answer on May 15, 2026 at 8:36 am

    It sounds like you’re heading in the right direction – essentially you need to create a custom route which looks at the request and constructs the route value dictionary. Rather than reinvent the wheel though, someone has already created a nice implementation which allows you to include placeholders in the domain itself like so:

    routes.Add("DomainRoute", new  DomainRoute(
    "{controller}.example.com",  "{action}/{id}",
    new { controller = "Home", action = "Index", id = "" }));
    

    http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx

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

Sidebar

Related Questions

I'm developing (.NET MVC) a large website which has the following specifications: Database pages
In my asp.net-mvc website I have a field that usually has a string (from
I have a an ASP .Net MVC website which works fine when testing locally.
I have a website which is built on ASP.NET MVC and hosted on Windows
I have developed a simple mechanism for my mvc website to pull in html
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I have an ASP.NET MVC (Beta 1) website that I'm using themes with. When
We have developed a website that uses MVC, C#, and jQuery. In one of
I have an asp.net mvc app running on a local iis website that is
I have an MVC-based site, which is using a Repository/Service pattern for data access.

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.