diff --git a/core/Piranha.AspNetCore/SitemapMiddleware.cs b/core/Piranha.AspNetCore/SitemapMiddleware.cs index 09f7785c5..e38bed94a 100644 --- a/core/Piranha.AspNetCore/SitemapMiddleware.cs +++ b/core/Piranha.AspNetCore/SitemapMiddleware.cs @@ -47,10 +47,8 @@ public override async Task Invoke(HttpContext context, IApi api, IApplicationSer if (useSitemapRouting && !IsHandled(context) && !context.Request.Path.Value.StartsWith("/manager/assets/")) { var url = context.Request.Path.HasValue ? context.Request.Path.Value : ""; - var host = context.Request.Host.Host; var scheme = context.Request.Scheme; - var port = context.Request.Host.Port; - var baseUrl = scheme + "://" + host + (port.HasValue ? $":{port}" : ""); + var baseUrl = scheme + "://" + service.Hostname; if (url.ToLower() == "/sitemap.xml") {