Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Skip to main content

Amazon API Gateway now supports routing rules for REST APIs

Posted on: Jun 3, 2025

Amazon API Gateway now supports routing rules for REST APIs using custom domain names. This new capability enables you to dynamically route incoming requests based on HTTP header values, URL base paths, or a combination of both.

This flexibility enables various use cases, including A/B testing, API versioning, and dynamic backend selection. You define routing rules through conditions (HTTP headers, URL paths, or both), actions, and priorities. API Gateway then evaluates these rules in priority order with lower numbers taking precedence. When a request meets all conditions in a rule, API Gateway routes it to a specific REST API ID and stage. By implementing routing logic directly within API Gateway, you can eliminate proxy layers and complex URL structures while maintaining granular routing control over your API traffic. This feature supports both public and private REST APIs and is compatible with existing api-mappings.

Routing Rules for custom domains is now available on API Gateway in Amazon Web Services China (Beijing) Region, operated by Sinnet, and Amazon Web Services China (Ningxia) Region, operated by NWCD. Please visit the API Gateway documentation to learn more.