© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
misk

❔ Blazor server app, base url / base page to set environment

Hi 🙂
I have a Blazor Server app, where I would like to use some dynamic baseurl.
Say instead of mywebsite.com/users I would like it to be mywebsite.com/{Environment}/users so that I can see which environments users I am looking at.
Basically I would like to have that Environment path always filled, and if you hit the mywebsite.com directly I would the redirect it to mywebsite.com/production as an example.
How would I set that up? It seems like a weird thing to handle in the razor pages with something like @page /{Environment}/users on all my pages including having to handle the logic of switching/using the correct environment on all pages.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Blazor App
C#CC# / help
2y ago
Cannot set up swagger in blazor app
C#CC# / help
2y ago
Difficulty with Blazor Server chat app
C#CC# / help
2y ago