[bug] SPA routing catches /tower/api and other sub-paths #8

Closed
opened 2026-03-19 18:36:17 +00:00 by Timmy · 1 comment

Problem

All sub-paths under /tower/ (e.g. /tower/api, /tower/anything) resolve
to the same SPA page. This means mistyped URLs or direct API path access from
the tower context silently load the wrong page instead of returning a proper
404 or redirecting.

Solution

Configure the SPA router or server to:

  • Only catch known Tower routes
  • Return 404 for unknown sub-paths
  • Or redirect unknown paths to the Tower root with a toast notification

Acceptance Criteria

  • /tower/ loads the Tower World correctly
  • /tower/nonexistent returns 404 or redirects with notification
  • Known routes (if any sub-routes exist) still work

Severity

Low — cosmetic/correctness issue, not blocking functionality.

Reported By

Perplexity Comet automated browser test, 2026-03-19

## Problem All sub-paths under `/tower/` (e.g. `/tower/api`, `/tower/anything`) resolve to the same SPA page. This means mistyped URLs or direct API path access from the tower context silently load the wrong page instead of returning a proper 404 or redirecting. ## Solution Configure the SPA router or server to: - Only catch known Tower routes - Return 404 for unknown sub-paths - Or redirect unknown paths to the Tower root with a toast notification ## Acceptance Criteria - [ ] `/tower/` loads the Tower World correctly - [ ] `/tower/nonexistent` returns 404 or redirects with notification - [ ] Known routes (if any sub-routes exist) still work ## Severity Low — cosmetic/correctness issue, not blocking functionality. ## Reported By Perplexity Comet automated browser test, 2026-03-19
claude was assigned by Rockachopa 2026-03-22 21:44:43 +00:00
Owner

PR #9 created.

Changes:

  • Added 404.html — a styled "Lost in the Tower" page matching the site design
  • Added client-side path validation in world/index.html that redirects unknown sub-paths (e.g. /world/api, /world/nonexistent) to the 404 page via window.location.replace

The script checks if the current path is exactly /world (with or without trailing slash). Any other sub-path gets redirected to /404.html. The 404 page links back to the entry hall.

PR #9 created. **Changes:** - Added `404.html` — a styled "Lost in the Tower" page matching the site design - Added client-side path validation in `world/index.html` that redirects unknown sub-paths (e.g. `/world/api`, `/world/nonexistent`) to the 404 page via `window.location.replace` The script checks if the current path is exactly `/world` (with or without trailing slash). Any other sub-path gets redirected to `/404.html`. The 404 page links back to the entry hall.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/alexanderwhitestone.com#8