2 Commits

Author SHA1 Message Date
Alexander Whitestone
ad41d3eef7 fix: add 404 page and reject unknown sub-paths under /world/
Adds a custom 404.html page and client-side path validation in
world/index.html so that unknown sub-paths like /world/api or
/world/nonexistent redirect to the 404 page instead of silently
loading the Workshop SPA.

Fixes #8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 18:06:08 -04:00
cbcad273ef [loop-cycle] feat: aw-post CLI — --from-x, --file, --help (#219) (#3) 2026-03-18 21:46:11 -04:00
2 changed files with 64 additions and 0 deletions

55
404.html Normal file
View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lost in the Tower</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #0a0a0f;
color: #e0d8c8;
font-family: Georgia, 'Times New Roman', serif;
}
h1 {
font-size: 1.4rem;
font-weight: normal;
letter-spacing: 0.15em;
text-transform: uppercase;
margin-bottom: 1.5rem;
color: #8a7f6a;
}
p {
font-size: 0.9rem;
color: #6a6050;
margin-bottom: 2rem;
}
a {
color: #8a7f6a;
text-decoration: none;
padding: 0.8rem 2rem;
border: 1px solid #2a2520;
transition: border-color 0.3s, color 0.3s;
}
a:hover {
border-color: #8a7f6a;
color: #fff;
}
</style>
</head>
<body>
<h1>Lost in the Tower</h1>
<p>This room doesn't exist.</p>
<a href="/">Return to the Entry Hall</a>
</body>
</html>

View File

@@ -31,6 +31,15 @@
<p><a href="/">← Back to the Tower</a></p>
</div>
</div>
<!-- Reject unknown sub-paths: only /world/ is valid -->
<script>
(function() {
var path = window.location.pathname.replace(/\/+$/, '') || '/';
if (path !== '/world') {
window.location.replace('/404.html');
}
})();
</script>
<!-- Three.js scene will mount to #scene -->
<!-- <script type="module" src="main.js"></script> -->
</body>