Skip to content

Commit

Permalink
use separate domain instead of subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
kkuepper committed Jun 18, 2024
1 parent cdcb702 commit 099a23c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BMM.Website/HtmlResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public async Task ExecuteAsync(HttpContext httpContext)

public static class Helper
{
public static IResult Result()
public static IResult Redirect()
{
return new RedirectResult();
}
Expand Down
7 changes: 3 additions & 4 deletions BMM.Website/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Globalization;
using BMM.Website;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Rewrite;

var builder = WebApplication.CreateBuilder(args);
Expand All @@ -14,12 +13,12 @@

var handler = (HttpContext context) =>
{
if (context.Request.QueryString.ToUriComponent().Contains("force-old"))
if (context.Request.Host.ToUriComponent().EndsWith("bmm.brunstad.org"))
{
return new HtmlResult(indexFile);
return Helper.Redirect();
}
return Helper.Result();
return new HtmlResult(indexFile);
};

app.MapGet("/", handler);
Expand Down

0 comments on commit 099a23c

Please sign in to comment.