Skip to content

Commit a121a1c

Browse files
committed
Added 404.html to redirect legacy docs urls.
1 parent f1f99cd commit a121a1c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

404.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Redirecting...</title>
6+
<script type="text/javascript">
7+
// Get the part of the URL after the domain
8+
var path = window.location.pathname;
9+
10+
// Check if it matches the old API docs pattern:
11+
// /docs/api/[lang]/[...any...]/[...path...]/PageName.html
12+
// The ".*" part will greedily match any category path.
13+
var match = path.match(/\/docs\/api\/[^\/]+\/.*\/([^\.]+)\.html/);
14+
15+
if (match && match[1]) {
16+
// match[1] will be "AnimationMixer" or "ColorKeyframeTrack"
17+
var pageName = match[1];
18+
19+
// Construct the new URL and redirect.
20+
window.location.replace("https://threejs.org/docs/#" + pageName);
21+
}
22+
</script>
23+
</head>
24+
<body>
25+
</body>
26+
</html>

0 commit comments

Comments
 (0)