make Url Mappings relative rather than absolute

This commit is contained in:
Shaun Walker
2022-01-03 10:56:13 -05:00
parent 224618cf21
commit eeff4af167
8 changed files with 122 additions and 84 deletions

View File

@ -234,10 +234,12 @@
}
else // page not found
{
var urlMapping = await UrlMappingService.GetUrlMappingAsync(site.SiteId, route.SiteUrl + "/" + route.PagePath);
// look for url mapping
var urlMapping = await UrlMappingService.GetUrlMappingAsync(site.SiteId, route.PagePath);
if (urlMapping != null && !string.IsNullOrEmpty(urlMapping.MappedUrl))
{
NavigationManager.NavigateTo(urlMapping.MappedUrl, false);
var url = (urlMapping.MappedUrl.StartsWith("http")) ? urlMapping.MappedUrl : route.SiteUrl + "/" + urlMapping.MappedUrl;
NavigationManager.NavigateTo(url, false);
}
else // not mapped
{