Forum Discussion

Julien_Marpault's avatar
Julien_Marpault
Copper Contributor
Nov 10, 2021
Solved

Blazor WebAssembly Subdomain routing

Hello,

 

Is someone knows if it's possible to use subdomain routing with Blazor WASM ?

 

I have a project where each user space is a subdomain.
ex: 
julien.contoso.com
john.contoso.com
....

Thanks for you help.

 

  • I don't understand why would you want to do it that way ...

    Provided you have all the URL of each user pointing at the proper resource where the app is hosted, you could do it by retrieving the URL in the code, parsing the username from it, and use it as a cascading parameter for instance... (You would have to implement this yourself)

    But wouldn't it be easier just using the default routing method? contoso.com/julien/xxx, contoso.com/john/xxx

    Regards,
    Iker

2 Replies

  • ikulloa's avatar
    ikulloa
    Copper Contributor
    I don't understand why would you want to do it that way ...

    Provided you have all the URL of each user pointing at the proper resource where the app is hosted, you could do it by retrieving the URL in the code, parsing the username from it, and use it as a cascading parameter for instance... (You would have to implement this yourself)

    But wouldn't it be easier just using the default routing method? contoso.com/julien/xxx, contoso.com/john/xxx

    Regards,
    Iker
    • Julien_Marpault's avatar
      Julien_Marpault
      Copper Contributor
      Hello,
      Cascading parameter is a good idea, I’ll take a look.
      I want to do that because I’m remastering an old MVC app which is is based on sub domains. If possible I would prefer to keep same routes.

      Thanks.

Resources