Menu
CoddyTech

Unmatched Paths

Part of the Routing and State section of Coddy's Vue journey. Lesson 27 of 55.

A catch-all record gives unmatched locations a useful page. The repeatable pattern below accepts any remaining path segments, while more specific records still handle their known locations.

{path:'/:pathMatch(.*)*',component:NotFound}

A catch-all view can show the requested path and a link back to a known page. It handles missing route patterns, unlike the earlier catalog fallback inside a matched dynamic route. Keeping the unknown path visible helps explain what was requested without inventing a valid page.

challenge icon

Challenge

Medium

Add a catch-all route /:pathMatch(.*)* for Missing.vue. Unknown paths show Page not found in h2#view and the current path in p#requested, without redirecting. Known Calendar and Help paths must still work.

Keep the supplied route readout and bootstrap files.

Try it yourself

<!doctype html><html><head><meta charset="UTF-8"><title>Routing practice</title></head><body><div id="app"></div><script type="module" src="./main.js"></script></body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Routing and State