> For the complete documentation index, see [llms.txt](https://www.axisnow.io/zh/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.axisnow.io/zh/docs/edge/policies/request-processing/use-cases.md).

# 配置场景

请求处理的典型配置场景与规则参数

各表里的域名、路径都是示例值。

## 旧页面迁移 <a href="#page-moved" id="page-moved"></a>

单个页面换了地址，旧链接仍在外部流传。

<table data-search="false"><thead><tr><th width="140">配置项</th><th>取值</th></tr></thead><tbody><tr><td>条件</td><td>请求 Host 在以下各项之中 <code>www.example.com</code>，并且 请求 URI 路径 等于 <code>/pricing-2025</code></td></tr><tr><td>URL 重定向</td><td>静态 URL <code>https://www.example.com/pricing</code></td></tr><tr><td>状态码</td><td>301</td></tr></tbody></table>

## 根域名跳转到 www <a href="#root-to-www" id="root-to-www"></a>

路径和查询串原样保留。条件只写根域名，跳到 www 后不再命中。

<table data-search="false"><thead><tr><th width="140">配置项</th><th>取值</th></tr></thead><tbody><tr><td>条件</td><td>请求 Host 在以下各项之中 <code>example.com</code></td></tr><tr><td>URL 重定向</td><td>动态构建：协议 <code>https://</code>，域名 <code>www.example.com</code>，路径和查询串留空</td></tr><tr><td>状态码</td><td>308</td></tr></tbody></table>

## 批量迁移路径 <a href="#path-prefix" id="path-prefix"></a>

一组路径迁到新的域名或前缀，保留其后的部分。

<table data-search="false"><thead><tr><th width="140">配置项</th><th>取值</th></tr></thead><tbody><tr><td>条件</td><td>请求 Host 在以下各项之中 <code>www.example.com</code>，并且 请求 URI 路径 开头为 <code>/blog/</code></td></tr><tr><td>URL 重定向</td><td>通配符匹配：模式 <code>https://www.example.com/blog/*</code>，目标模板 <code>https://blog.example.com/${1}</code>，开启保留原查询参数</td></tr><tr><td>状态码</td><td>301</td></tr></tbody></table>

## 按访客所在国家分流 <a href="#geo" id="geo"></a>

某个国家或地区的访客跳到当地站点，路径和查询串保留。

<table data-search="false"><thead><tr><th width="140">配置项</th><th>取值</th></tr></thead><tbody><tr><td>条件</td><td>请求 Host 在以下各项之中 <code>www.example.com</code>，并且 客户端 IP 区域 在以下各项之中 英国</td></tr><tr><td>URL 重定向</td><td>动态构建：协议 <code>https://</code>，域名 <code>uk.example.com</code>，路径和查询串留空</td></tr><tr><td>状态码</td><td>302</td></tr></tbody></table>

访客自己选择的站点要优先于 IP 所在国家时，用自定义脚本，见[边缘运行时 › 按访客所在国家跳转](/zh/docs/edge/policies/edge-runtime.md#example-geo-redirect)。

## 维护页 <a href="#maintenance" id="maintenance"></a>

源站停机期间由边缘返回维护页，维护结束后停用规则。

<table data-search="false"><thead><tr><th width="140">配置项</th><th>取值</th></tr></thead><tbody><tr><td>条件</td><td>请求 Host 在以下各项之中 <code>www.example.com</code></td></tr><tr><td>响应码</td><td>预设 503 维护页</td></tr><tr><td>响应头</td><td>加入预设 <code>Cache-Control: no-store</code></td></tr><tr><td>响应体</td><td>开启，维护页面</td></tr></tbody></table>

## 固定内容的文件 <a href="#static-file" id="static-file"></a>

`robots.txt`、`security.txt`、验证文件这类内容固定的小文件由边缘直接返回。

<table data-search="false"><thead><tr><th width="140">配置项</th><th>取值</th></tr></thead><tbody><tr><td>条件</td><td>请求 Host 在以下各项之中 <code>www.example.com</code>，并且 请求 URI 路径 等于 <code>/robots.txt</code></td></tr><tr><td>响应码</td><td>200</td></tr><tr><td>响应头</td><td><code>Content-Type: text/plain; charset=utf-8</code></td></tr><tr><td>响应体</td><td>开启，文件内容</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.axisnow.io/zh/docs/edge/policies/request-processing/use-cases.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
