Skip to content

Commit aae9bb8

Browse files
committed
feat(404): add redirect from /documents/** to root path
The site was previously hosted at /documents but has been moved to the root path. This adds a 404.html that automatically redirects legacy /documents/** URLs to their new locations, preserving query parameters and hashes. Examples: - /documents → / - /documents/docs/scenario → /docs/scenario - /documents/api/core?tab=types → /api/core?tab=types This ensures existing external links and bookmarks continue to work.
1 parent 3ef1307 commit aae9bb8

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

public/404.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Redirecting... | Probitas</title>
7+
<script>
8+
(function() {
9+
var path = window.location.pathname;
10+
// Redirect /documents/** to /**
11+
if (path === '/documents' || path.startsWith('/documents/')) {
12+
var newPath = path.replace(/^\/documents/, '') || '/';
13+
window.location.replace(newPath + window.location.search + window.location.hash);
14+
}
15+
})();
16+
</script>
17+
<style>
18+
body {
19+
font-family: system-ui, -apple-system, sans-serif;
20+
display: flex;
21+
justify-content: center;
22+
align-items: center;
23+
min-height: 100vh;
24+
margin: 0;
25+
background: #f5f5f5;
26+
color: #333;
27+
}
28+
.container {
29+
text-align: center;
30+
padding: 2rem;
31+
}
32+
h1 {
33+
font-size: 4rem;
34+
margin: 0 0 1rem;
35+
color: #666;
36+
}
37+
p {
38+
font-size: 1.2rem;
39+
margin: 0 0 2rem;
40+
}
41+
a {
42+
color: #0066cc;
43+
text-decoration: none;
44+
}
45+
a:hover {
46+
text-decoration: underline;
47+
}
48+
</style>
49+
</head>
50+
<body>
51+
<div class="container">
52+
<h1>404</h1>
53+
<p>Page not found</p>
54+
<p><a href="/">Go to homepage</a></p>
55+
</div>
56+
</body>
57+
</html>

0 commit comments

Comments
 (0)