|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <html lang="en-US">
|
3 |
| - <meta charset="utf-8"> |
4 |
| - <title>Redirecting…</title> |
5 |
| - <link rel="canonical" href="{{ page.redirect.to }}"> |
6 |
| - <script>location="{{ page.redirect.to }}"</script> |
7 |
| - <meta http-equiv="refresh" content="0; url={{ page.redirect.to }}"> |
8 |
| - <meta name="robots" content="noindex"> |
9 |
| - <h1>Redirecting…</h1> |
10 |
| - <a href="{{ page.redirect.to }}">Click here if you are not redirected.</a> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <title>Redirecting…</title> |
| 6 | + <link rel="canonical" href="{{ page.redirect.to }}" /> |
| 7 | + <script> |
| 8 | + const urlSuffix = |
| 9 | + "" + |
| 10 | + (location.hash ? location.hash : "") + |
| 11 | + (location.search ? location.search : ""); |
| 12 | + location = "{{ page.redirect.to }}" + urlSuffix; |
| 13 | + </script> |
| 14 | + <meta |
| 15 | + id="refresh-meta" |
| 16 | + http-equiv="refresh" |
| 17 | + content="0; url={{ page.redirect.to }}" |
| 18 | + /> |
| 19 | + <meta name="robots" content="noindex" /> |
| 20 | + </head> |
| 21 | + <body> |
| 22 | + <h1>Redirecting…</h1> |
| 23 | + <a id="redirect-link" href="{{ page.redirect.to }}" |
| 24 | + >Click here if you are not redirected.</a |
| 25 | + > |
| 26 | + <script> |
| 27 | + // Add hash and search to meta redirect and manual link, in case script above did not work |
| 28 | + const urlSuffix2 = |
| 29 | + "" + |
| 30 | + (location.hash ? location.hash : "") + |
| 31 | + (location.search ? location.search : ""); |
| 32 | + let refreshMeta = document.getElementById("refresh-meta"); |
| 33 | + const newContentStr = refreshMeta.getAttribute("content") + urlSuffix2; |
| 34 | + refreshMeta.setAttribute("content", newContentStr); |
| 35 | + let redirectLink = document.getElementById("redirect-link"); |
| 36 | + const newHrefUrl = redirectLink.getAttribute("href") + urlSuffix2; |
| 37 | + redirectLink.setAttribute("href", newHrefUrl); |
| 38 | + </script> |
| 39 | + </body> |
11 | 40 | </html>
|
0 commit comments