How can I route app.website.com and website.com differently in the same TanStack Start app?
I want to serve both website.com (for the public homepage) and app.website.com (for auth and dashboard) from the same codebase and deployment.
4 Replies
noble-gold•3w ago
you could have a layout route that checks, during beforeLoad, the base url, and redirects accordingly, or 404
xenial-blackOP•3w ago
Sorry, I'm a little bit confused. How would this work?
noble-gold•3w ago
_public/route.tsx
_public/foo.tsx (only accessible via
https://website.com/foo
)
...
_dashboard/route.tsx
_dashboard/bar.tsx (only accessible via https://app.website.com/bar
...
something like thatxenial-blackOP•3w ago
Okay, this makes sense. I'll try this. Thank you.