Jelajahi Sumber

Added 404.html to redirect legacy docs urls.

Mr.doob 5 bulan lalu
induk
melakukan
a121a1cbf5
1 mengubah file dengan 26 tambahan dan 0 penghapusan
  1. 26 0
      404.html

+ 26 - 0
404.html

@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Redirecting...</title>
+  <script type="text/javascript">
+    // Get the part of the URL after the domain
+    var path = window.location.pathname;
+
+    // Check if it matches the old API docs pattern:
+    // /docs/api/[lang]/[...any...]/[...path...]/PageName.html
+    // The ".*" part will greedily match any category path.
+    var match = path.match(/\/docs\/api\/[^\/]+\/.*\/([^\.]+)\.html/);
+
+    if (match && match[1]) {
+      // match[1] will be "AnimationMixer" or "ColorKeyframeTrack"
+      var pageName = match[1];
+      
+      // Construct the new URL and redirect.
+      window.location.replace("https://threejs.org/docs/#" + pageName);
+    }
+  </script>
+</head>
+<body>
+</body>
+</html>

粤ICP备19079148号