4.3.2. URL-Based Routing
Route traffic to different backends based on URL path:
Multi-site Hosting: Host multiple websites on single Application Gateway:
| Listener | Host Header | Backend |
|---|---|---|
| Listener 1 | www.contoso.com | Contoso pool |
| Listener 2 | www.fabrikam.com | Fabrikam pool |
These are two different axes, and the exam tests whether you can tell them apart. Multi-site routing splits by hostname and is decided at the listener, because the listener is what reads the host header. Path-based routing splits by URL path within a single site and is decided at the rule, through a path map. A design serving two hostnames that each need path splitting uses both: two listeners, each with its own path-based rule.
Every path map needs a default pool. A request matching none of the configured paths goes to the default backend, so leaving it unset is how a valid request ends up with no destination.
⚠️ Exam Trap: Path patterns are matched in the order they are listed, so a broad /* placed above /api/* swallows everything and the more specific rule never fires.