Base solution for your next web application
Open Closed

linking different domain names to tenant names #3806


User avatar
0
mdonogma created

If i register domainABC.com and domainXYZ.com

is it possible to wire different domains up to point to specific tenant names? example: domainABC.com should map to tenantA.rootdomain.com (where aspzero code is hosted) domainXYZ.com should map to tenantB.rootdomain.com (where aspzero code is hosted)


2 Answer(s)
  • User Avatar
    0
    ervingayle created

    Do you want the first domain name (domainABC.com) to remain in the browser url bar or can the user be redirected to tenanta.rootdomain.com? If not, then you can do this in DNS using cnames. If you do then I am not sure how the mapping management would work.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Mdonogma,

    You can write a custom tenant resolver, see <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#determining-current-tenant">https://aspnetboilerplate.com/Pages/Doc ... ent-tenant</a>.

    Basically you extract tenant name from current url like you want by a custom tenant resolver. After writing your class, you can add it to resolvers like this:

    Configuration.MultiTenancy.Resolvers.Add<YourCustomTenantResolveContributor>();