From df986a2e36f672d34797bc36aec4c29a27ad643b Mon Sep 17 00:00:00 2001 From: Flaminel Date: Mon, 23 Feb 2026 17:24:48 +0200 Subject: [PATCH] Redirect to base path from root path (#466) --- code/backend/Cleanuparr.Api/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/backend/Cleanuparr.Api/Program.cs b/code/backend/Cleanuparr.Api/Program.cs index d1266bcc..53af13d0 100644 --- a/code/backend/Cleanuparr.Api/Program.cs +++ b/code/backend/Cleanuparr.Api/Program.cs @@ -131,6 +131,13 @@ if (basePath is not null) { if (!string.IsNullOrEmpty(basePath) && !context.Request.Path.StartsWithSegments(basePath, StringComparison.OrdinalIgnoreCase)) { + // Redirect root to the base path for convenience + if (!context.Request.Path.HasValue || context.Request.Path.Value == "/") + { + context.Response.Redirect(basePath + "/"); + return; + } + context.Response.StatusCode = StatusCodes.Status404NotFound; return; }