Skip to content

Blazor - Allow hashed routing #6175

Open
@LukeTOBrien

Description

@LukeTOBrien

Hello there.

I have just been reading this in-depth guide.
In the section Client Routing the article states:

One caveat with routing is that it uses normal URLs and there is no hashed mode.
That is, a @page "/counter" will be accessible at the /counter URL and there is no option to use #/counter.
While this is something desirable in most cases, it means that the server hosting the Blazor app should be configured to redirect all URLs that don’t match a static file to the index.html file, which will then bootstrap the application in the browser and will ultimately perform the navigation.

I have recently created a Angular app that required hashed routes, as it was purely client-side, the server was a MVC controller and I did not want my client making requests to the server... only for the server to redirect to index.html... plus I found that the server had trouble deciding between component and API routes.

I think hashed routes are a very important feature, and for my previous project they where a necessity.

Hope this is added in future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Complete Blazor WebPriority:2Work that is important, but not critical for the releaseaffected-very-fewThis issue impacts very few customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futureseverity-minorThis label is used by an internal tool

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions