You handle dynamic segments in a route by using a colon followed by the parameter name in the route path, e.g., /user/:id.