URL Routes table mapping paths to HTML files
Routes UI

Appifio Creator · Lesson T08 · Technical

Routes vs file path
- why a file can still 404

An HTML file on disk ≠ a URL visitors can open. A route is the bridge in routes.json; a missing route or a relative URL broken by the base tag is the classic 404 cause.

Goal: Do the five UI steps on the Routes tab correctly; understand nested slugs; absolute URLs; and Routes Save vs Save changes.

Time: 11-13 min · Before: D02 · After: T09

UI: Routes tab · Add Route · Route Path · Target File · green/gray toggle · Save

1. Diagram

Visitor opens: https://site/{url}/blog/hello-world
→ look up routes.json
→ route blog/hello-world → file blog-detail.html (example)
→ render HTML + inject client
blog-detail.html exists under Files but no route → 404
Route off (gray toggle) → 404 or hidden

2. Example routes.json (logic)

{ "blog": "blog-list.html",
  "blog/hello-world": "blog-detail.html",
  "shop": "products.html",
  "contact": "contact.html" }

The CMS manifest may declare list/detail slugs - the route must match after you publish a post (G04/T05).

3. Glossary

TermMeaning
Route PathSlug: letters, digits, - _; nested tag/slug
Target FileHTML file on the project file store (dropdown on Routes)
generateSlug()Helper that builds a slug from a post title
Absolute URLRequired for navigation - the base tag breaks relative URLs
addRoute / removeRouteAPIs instead of hand-editing routes.json (T04)

4. Five steps with exact UI labels

routes.json open in Code editor
routes.json
  1. Click "Add Route".
  2. Enter Route Path (letters, digits, hyphen, underscore only).
  3. Pick Target File from the dropdown.
  4. Enable the route - toggle green (gray = off).
  5. Click "Save" on the Routes tab → writes routes.json.

Don’t confuse: Save on Routes ≠ Creator toolbar Save changes. You need both if you’re on an unpublished draft virtual disk (T01).

5. Comparisons · Limits · Security

  • Next.js file-based routing: file path ≈ URL; Appifio keeps file ↔ route separate.
  • WordPress permalinks: rewrite ≈ routes.json.

Limits: duplicate slug → later route wins; no arbitrary wildcards unless the UI supports them.

Security: don’t route an admin page to an obvious slug without auth (T07). /cms is usually bootstrapped by Aura CMS.

6. CMS publish → route flow

  1. Editor publishes a post as Published in /cms - slug e.g. hello-world.
  2. CMS/manifest declares detail pattern blog/{slug} → route needs blog/hello-world.
  3. AI or addRoute creates a route pointing to blog-detail.html (or the file in the manifest).
  4. Routes tab → green toggle → Save → Creator Save changes.
  5. Open the public URL - don’t open the raw file path on the server.

7. Issues · Checklist

IssueFix
404 even though HTML is under FilesAdd Route + Save; toggle on
Internal links breakAbsolute URL from site_url
Route edits don’t go liveForgot Routes Save; then Creator Save changes
Deleted CMS post leaves a dead URLRemove the matching route (X04)
  1. After AI creates a new page, do you check the Routes tab?
  2. Do you Save on Routes (not only Save changes)?
  3. Do links in HTML use absolute URLs?

Next: T09 - View space (four modes)

Appifio Creator · User guide · T08