A relative URL names a navigation target without a leading slash, so Blazor WebAssembly resolves it against the application root defined by the base element. section 37.3.2
In a Blazor WebAssembly component, the leading character changes the destination:
- forms/create resolves against the /webassembly/ application root and navigates to /webassembly/forms/create. section 37.3.2
- /forms/create resolves from the site root and navigates outside the URLs managed by the /webassembly/ application. section 37.3.2
- Use this distinction for navigation URLs; URLs in the @page directive are unaffected. section 37.3.2
Component navigation
A NavLink can use href="forms/create" to keep navigation beneath the configured application root.
