diff --git a/TASVideos/Pages/Wiki/Render.cshtml.cs b/TASVideos/Pages/Wiki/Render.cshtml.cs index 26e3e8cda..ecf7826db 100644 --- a/TASVideos/Pages/Wiki/Render.cshtml.cs +++ b/TASVideos/Pages/Wiki/Render.cshtml.cs @@ -4,7 +4,12 @@ namespace TASVideos.Pages.Wiki; [AllowAnonymous] -public class RenderModel(IWikiPages wikiPages, ApplicationDbContext db, ILogger logger) : BasePageModel +public class RenderModel( + IWikiPages wikiPages, + ApplicationDbContext db, + IHostEnvironment env, + ILogger logger +) : BasePageModel { public IWikiPage WikiPage { get; set; } = null!; @@ -32,6 +37,12 @@ public async Task OnGet(string? url, int? revision = null) return Redirect(LinkConstants.HomePages + url); } + if (env.IsDevelopment() && url.StartsWith("media/")) + { + // fix missing images everywhere when running locally + return Redirect("/images/tasvideos_rss.png"); + } + return RedirectToPage("/Wiki/PageNotFound", new { possibleUrl = WikiEngine.Builtins.NormalizeInternalLink(url) }); }