Skip to main content

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 NameTypeRequiredDescription
matchstringYesUsed to match the URL
locationstringYesThe rewritten URL
status_codeintegerYesThe 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.