URL Rewriting
The URL rewriting function allows users to modify the addresses of HTTP requests that match a specific URL. Below is a detailed explanation of each field:
Field Name | Type | Required | Description |
---|---|---|---|
match | string | Yes | Used to match the URL |
location | string | Yes | The rewritten URL |
status_code | integer | Yes | The returned HTTP status code |
url_rewrites:
- match: "(.*google)\\.cn"
location: $1.com
status_code: 307
In this example, the system will search for all URLs matching the request pattern "(.*google)\.cn" and rewrite the URL to the corresponding ".com" domain, while setting the returned HTTP status code to 307. This feature is especially useful for regional website redirection or specific request forwarding.