Skip to content

Commit a3bc38d

Browse files
committed
use meta tag instead of JS redirect
1 parent c252d48 commit a3bc38d

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

create-redirects.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ const template =
1515
import { addBase } from '$lib';
1616
import Wrapper from '$lib/components/Wrapper.svelte';
1717
18-
if (typeof window !== 'undefined') {
19-
window.location.href = window.location.href.replace("{from}", "{to}");
20-
}
2118
</script>
2219
20+
<svelte:head>
21+
<meta http-equiv="refresh" content="0; url={addBase('{to}')}" />
22+
<title>Redirecting...</title>
23+
</svelte:head>
24+
2325
<Wrapper>
2426
<h1>Redirecting...</h1>
2527
<p>If you are not redirected automatically, please click <a href={addBase("{to}")}>here</a>.</p>

src/routes/aboutUs.html/+page.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
import { addBase } from '$lib';
66
import Wrapper from '$lib/components/Wrapper.svelte';
77
8-
if (typeof window !== 'undefined') {
9-
window.location.href = window.location.href.replace("/aboutUs.html", "/about-us");
10-
}
118
</script>
129

10+
<svelte:head>
11+
<meta http-equiv="refresh" content="0; url={addBase('/about-us')}" />
12+
<title>Redirecting...</title>
13+
</svelte:head>
14+
1315
<Wrapper>
1416
<h1>Redirecting...</h1>
1517
<p>If you are not redirected automatically, please click <a href={addBase("/about-us")}>here</a>.</p>

src/routes/donate.html/+page.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
import { addBase } from '$lib';
66
import Wrapper from '$lib/components/Wrapper.svelte';
77
8-
if (typeof window !== 'undefined') {
9-
window.location.href = window.location.href.replace("/donate.html", "/donate");
10-
}
118
</script>
129

10+
<svelte:head>
11+
<meta http-equiv="refresh" content="0; url={addBase('/donate')}" />
12+
<title>Redirecting...</title>
13+
</svelte:head>
14+
1315
<Wrapper>
1416
<h1>Redirecting...</h1>
1517
<p>If you are not redirected automatically, please click <a href={addBase("/donate")}>here</a>.</p>

src/routes/ourSites.html/+page.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
import { addBase } from '$lib';
66
import Wrapper from '$lib/components/Wrapper.svelte';
77
8-
if (typeof window !== 'undefined') {
9-
window.location.href = window.location.href.replace("/ourSites.html", "/our-sites");
10-
}
118
</script>
129

10+
<svelte:head>
11+
<meta http-equiv="refresh" content="0; url={addBase('/our-sites')}" />
12+
<title>Redirecting...</title>
13+
</svelte:head>
14+
1315
<Wrapper>
1416
<h1>Redirecting...</h1>
1517
<p>If you are not redirected automatically, please click <a href={addBase("/our-sites")}>here</a>.</p>

0 commit comments

Comments
 (0)