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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:19:38+00:00 2026-05-27T09:19:38+00:00

I have an application that is multitenant, that is, I have multiple clients that

  • 0

I have an application that is multitenant, that is, I have multiple clients that use the application and share a single domain using folders. Like the following:

  1. http://www.mydomain.com/client1/home/index
  2. http://www.mydomain.com/client2/home/index

I can’t use areas because the clients are not static, they register and they must be able to start using the application right away. I can’t use subdomains because in this case I don’t have dynamic control over the DNS.

That being said, how can I implement a custom route so that I don’t need to pass the client name every time I build an outgoing URL?

That is, I want this to be true:

@Url.Action("Index", "Home") -> www.mydomain.com/client1/home/index

without passing client1, something can resolve client1 because by the time I build this URL, this string will be a value of the current route values, because I’m already at the client1

How can I do that?

  • 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-27T09:19:39+00:00Added an answer on May 27, 2026 at 9:19 am
    routes.MapRoute(
        "Default",
        "{client}/{controller}/{action}/{id}",
        new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
    

    Now when you navigate to /client1/Home/Index and if inside the Index.cshtml view when you use:

    @Html.ActionLink("foo", "About")
    

    this will generate:

    <a href="/client1/home/About">foo</a>
    

    Same stands true for using the Url.Action helper inside the Index action. It will preserve the client route value from the original request.

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

Sidebar

Related Questions

I have an application that I would like to embed inside our companies CMS.
I have application that produces files. I would like to connect those files with
I have application that look like below without spring (prior) UI-> service --> javabean
i have application that generate php/html/asp web sites and i like to be able
I'm creating a multiple-tenant application that won't use any of the standard Django Admin
I have application that received data via HTTP POST requests. I'm trying to use
I have an application that uses the grails multi-tenant-core plug-in to host multiple versions
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in

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.