Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 63d9cbd

Browse files
committed
Retaining the fragment identifier when redirecting
Currently, if a user requests /team.html#foo and is redirected to the sv-SE language, the new location will be /sv-SE/team.html. This commit appends the fragment identifier to the redirection target. Thus, if a user is requesting /team.html#foo and is redirected to the sv-SE language, the new location will be /sv-SE/team.html#foo.
1 parent 2a7ef22 commit 63d9cbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_layouts/redirect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
// if we didn't find a supporting language, default to en-US
4343
if (!language) { language = "en-US"; }
4444

45-
document.location = "/" + language + '{{ page.url }}';
45+
document.location = "/" + language + '{{ page.url }}' + document.location.hash;
4646
</script>
4747
<noscript>
4848
<meta http-equiv="refresh" content="0; url=/en-US{{ page.url }}">

0 commit comments

Comments
 (0)