Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router: domain-based routing #214

Open
indeyets opened this issue Dec 4, 2022 · 4 comments
Open

Router: domain-based routing #214

indeyets opened this issue Dec 4, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@indeyets
Copy link

indeyets commented Dec 4, 2022

It would be great to have support for domain-based routing.
I need to be able to server different pages on different domains.

Could it be configured via additional sub-component of <Routes> maybe?

<Routes>
  <DomainRoutes domain=":language.example.com">
    <Route path="/some-page" component={LocalizedPage} />
  </DomainRoutes>

  <Route path="/some-page" component={DefaultPage} />
</Routes>
@indeyets
Copy link
Author

indeyets commented Dec 5, 2022

Or should this issue be moved to @solidjs/router instead?

@orenelbaum
Copy link
Contributor

Yeah I think that it should be moved to the router

@ryansolid ryansolid transferred this issue from solidjs/solid-start Dec 5, 2022
@ryansolid
Copy link
Member

ryansolid commented Aug 8, 2023

So I understand you have the same site more or less on different domains, and you would like certain routes to only appear on those Domains. The route definition is just JSON ultimately even though we use components, so it could be conditionally constructed I imagine. Unless I'm misunderstanding the use case.

I guess on the server you want to use the request to determine if the routes should be registered and in the client the current URL in the browser?

@ryansolid ryansolid added the enhancement New feature or request label Aug 8, 2023
@indeyets
Copy link
Author

indeyets commented Aug 8, 2023

Domains might have quite different sets of urls, actually. One case is "search." subdomain which would handle a separate set of "pages"

I talk about generic ability to match over domains in addition to the current ability of matching over paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants