> public static class HttpRequestExtensions {
> public static Uri GetRawUrl(this HttpRequest request)
> {
> var httpContext = request.HttpContext;
>
> var requestFeature = httpContext.Features.Get<IHttpRequestFeature>();
>
> return new Uri(requestFeature.RawTarget);
> } }
I think the problem here is that IIS rewrites occur before the app receives any requests, so the .netcore webapp never sees the original URL, I could be wrong but that's what it looks like. You would probably be better to write your own middleware do do the rewrites rather than using IIS it is not difficult
RawUrl in umbraco 11
Hi,
We are using umbraco 11 latest version. Is there any way to get RawUrl before rewrite in IIS? I have a rewrite rule in web.config which rewrite a url if match found. Now I want to get RawUrl e.g. My Raw url is https://example.com/drapes-equipment-covers/72586-00034-00/ rewrite to https://example.com/product/?x=drapes-equipment-covers&y=72586-00034-00 But RawTarget return https://example.com/product/?x=drapes-equipment-covers&y=72586-00034-00
Bump
I think the problem here is that IIS rewrites occur before the app receives any requests, so the .netcore webapp never sees the original URL, I could be wrong but that's what it looks like. You would probably be better to write your own middleware do do the rewrites rather than using IIS it is not difficult
is working on a reply...