Skip to content

Commit

Permalink
fix /track/{id} urls not being redirected to new website
Browse files Browse the repository at this point in the history
  • Loading branch information
kkuepper committed Aug 27, 2024
1 parent a84dec9 commit a46f5e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 18 additions & 2 deletions BMM.Website/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@

app.MapGet("/", handler);
app.MapGet("index.html", handler);
app.MapGet("/track/{path}", (string path) => new HtmlResult(indexFile, "/track/" + path));
app.MapGet("/track/{path}", (string path, HttpContext context) =>
{
if (context.Request.Host.ToUriComponent().EndsWith("bmm.brunstad.org"))
{
return Helper.Redirect();
}
return new HtmlResult(indexFile, "/track/" + path);
});
app.MapGet("/track/{path}/{subpath}",
(string path, string subpath) => new HtmlResult(indexFile, "/track/" + path + "/" + subpath));
(string path, string subpath, HttpContext context) =>
{
if (context.Request.Host.ToUriComponent().EndsWith("bmm.brunstad.org"))
{
return Helper.Redirect();
}
return new HtmlResult(indexFile, "/track/" + path + "/" + subpath);
});

// Make sure all patterns from client/app/scripts/app.js are also in here
app.MapGet("welcome/{*.}", handler);
Expand Down
6 changes: 5 additions & 1 deletion BMM.Website/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<!-- {{MetadataPlaceholder}} -->
<meta property="og:type" content="website"><meta property="og:image" content="https://bmm.brunstad.org/bmm-logo.jpg">
<meta property="og:site_name" content="bmm"><meta property="og:image:width" content="640"><meta property="og:image:height" content="640">
<link rel="dns-prefetch" href="https://bmm-api.brunstad.org/"><!-- From Australia or Brazil DNS lookup takes a lot of time. Therefore we prefetch it. --><link rel="shortcut icon" href="favicon.ico"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jplayer/2.6.0/skin/pink.flag/jplayer.pink.flag.min.css"><link rel="stylesheet" href="styles/4c9902c7.main.css"><!-- stylesheet link (common for all widgets) --><link href="https://widgets.bcc.no/styles/widgets.css" rel="stylesheet" type="text/css"><!-- end stylesheet link --><body><!-- Add your site or application content here --><div ng-include="'views/9c18b87c.main.html'"></div><!--[if lt IE 10]>
<link rel="dns-prefetch" href="https://bmm-api.brunstad.org/"><!-- From Australia or Brazil DNS lookup takes a lot of time. Therefore we prefetch it. --><link rel="shortcut icon" href="favicon.ico"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jplayer/2.6.0/skin/pink.flag/jplayer.pink.flag.min.css"><link rel="stylesheet" href="styles/4c9902c7.main.css"><!-- stylesheet link (common for all widgets) --><link href="https://widgets.bcc.no/styles/widgets.css" rel="stylesheet" type="text/css"><!-- end stylesheet link --><body>

<h2>Hello world</h2>

<!-- Add your site or application content here --><div ng-include="'views/9c18b87c.main.html'"></div><!--[if lt IE 10]>
<div style="position: fixed;
left: 0;
top: 0;
Expand Down

0 comments on commit a46f5e1

Please sign in to comment.