如果您访问的URI与源站URI不匹配,则需要将URI修改为与源站匹配的URI。您修改URI中的指定参数时,需要配置URI重写规则,规则匹配后会302重定向到目标URI。
适用场景
如果您需要将实际访问的URI修改为与源站匹配的URI,您可以通过配置重写功能,将实际访问的URI 302重定向到目标URI。例如,某些用户或客户端仍使用HTTP协议访问www.example.com/hello
,您配置重写功能后,所有www.example.com/hello
的请求都会重定向到www.example.com/index.html
。
操作步骤
配置示例
示例 | 待重写URI | 目标URI | 执行规则 | 结果说明 |
---|---|---|---|---|
示例一 | /hello | /index.html | Redirect | 客户端请求www.domain.com/hello ,CDN节点将返回302让客户端重新请求www.domain.com/index.html 的内容。
|
示例二 | ^/$ | /index.html | Redirect | 客户端请求www.domain.com ,CDN节点将返回302让客户端重新请求www.domain.com/index.html 的内容。
|
示例三 | /hello | /hello/index.html | Redirect | 客户端请求www.domain.com/hello ,CDN节点将返回302让客户端重新请求www.domain.com/hello/index.html 的内容。
|
示例四 | ^/hello$ | /index.html | Break | 客户端请求www.domain.com/hello ,CDN节点将返回www.domain.com/index.html 的内容,且该请求不再继续匹配剩余规则。
|
在文档使用中是否遇到以下问题
更多建议
匿名提交