aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

www to non-www #193

Closed alvipeo closed 5 years ago

alvipeo commented 7 years ago

Hi! I'm trying to do a simple thing - force 301 for www to non-www. Like described here - http://stackoverflow.com/questions/41205435/asp-net-core-1-1-url-rewriting-www-to-non-www. Can you please tell me why it doesn't work?

Thank you!

jkotalik commented 7 years ago

Hey, I just added a response on SO. The issue is that the regex match is done on the path/query string rather than the whole URL. This is standard for most/ all url rewriters, so I created a quick custom one with an Action.

davidpeden3 commented 7 years ago

Pretty sure this is a duplicate of https://github.com/aspnet/BasicMiddleware/issues/196. Well, technically the other way around but 196 contains the relevant detail in the issue without linking to SO.

muratg commented 7 years ago

Closing this and keeping #194 open instead.