2025-05-24
Today I learned you can deploy the same page but have it behave differently based on the domain it's accessed from. This lets you run multiple sites from a single deployment!
I wanted my personal site (isaacflath.com
) and consulting site (kentro.tech
) to be the same Railway deployment, but show different content on the index route depending on which domain was used.
Check the host
header in the request and route accordingly:
@rt
def index(request):
host = request.headers.get("host", "")
if 'kentro.tech' in host:
from consulting import consulting_index
return consulting_index()
else:
return aboutme()
host
headerisaacflath.com
→ Personal about me pagekentro.tech
→ Consulting services page