Standard HttpModules work fine.
You can also add your own IRouteHandler and specifically register routes with this (or capture the current route definitions and replace them with your route handler).
This will give you the flexibility you need.
source share