Skip to content

Commit 7d0e817

Browse files
committed
js/404: redirect links to old copy of site to new, subpath-less versions
Signed-off-by: Ruby Iris Juric <[email protected]>
1 parent cb72418 commit 7d0e817

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/assets/js/404.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,9 @@ function buildResult(result) {
5656
$result.append($('<a/>').text(result.title).attr('href', result.url));
5757
return $result;
5858
}
59+
60+
// Redirect links to the old copy of the site (ie. https://developer.rebble.io/developer.pebble.com/) to strip the
61+
// subpath
62+
if (location.pathname.startsWith('/developer.pebble.com/')) {
63+
location.pathname = location.pathname.replace('/developer.pebble.com/', '/')
64+
}

0 commit comments

Comments
 (0)