To handle 404 pages with <Switch>, you place a <Route> without a path at the end. This route will match any location that doesn't match any of the previous routes.