Skip to content

Commit 9a1d729

Browse files
authored
Alias: preserve the hash when redirecting (#2851)
1 parent 4b35993 commit 9a1d729

File tree

1 file changed

+8
-2
lines changed
  • components/templates/src/builtins/internal

1 file changed

+8
-2
lines changed
+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<!doctype html>
22
<meta charset="utf-8">
3-
<link rel="canonical" href="{{ url | safe }}">
4-
<meta http-equiv="refresh" content="0; url={{ url | safe }}">
53
<title>Redirect</title>
4+
<script>
5+
const target = "{{ url | safe }}";
6+
const hash = window.location.hash || "";
7+
window.location.replace(target + hash);
8+
</script>
9+
<noscript>
10+
<meta http-equiv="refresh" content="0; url={{ url | safe }}">
11+
</noscript>
612
<p><a href="{{ url | safe }}">Click here</a> to be redirected.</p>

0 commit comments

Comments
 (0)