Skip to content

Routing paths with dots #51818

@kuhnboy

Description

@kuhnboy

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

As described in #17334

WASM Blazor apps have an issue with routing paths with 'dots' in them.

This is not a problem with Blazor itself though as it handles 'dots' in routes just fine, but it is a problem with the Kestrel server when running in Visual Studio locally. There is no way to change the rewrite rules with Kestrel that I can see.

If you write a simple web.config with rewrite rules, you can get around this limitation of Kestrel by using IIS Express profile.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<location path="." inheritInChildApplications="false">
		<system.webServer>
			<rewrite>
				<rules>
					<rule name="Redirect to Single Page">
						<match url="^fetchdata/.*" />
						<action type="Rewrite" url="/index.html" />
					</rule>
				</rules>
			</rewrite>
		</system.webServer>
	</location>
</configuration>

You can also get around this issue in Azure static apps with a config file.

Describe the solution you'd like

I would like to be able to configure the WebHost run when debugging a client side Blazor WASM so that I can use 'dots' in URL's.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions