跳转到内容
搜索文档

将来自某一国家/地区的请求重定向到域名

创建一条重定向规则,将来自英国的所有网站访问者重定向到不同的域名,同时在相同路径上保持当前功能。 Kingdom to a different domain, maintaining the current functionality in the same paths.

最后更新 查看 MarkdownAgent 设置

在本示例中,来自英国的所有网站访问者将被重定向到不同的域名,但会在相同路径上保持当前功能。

  1. 创建一个名为 uk_redirect_list 的 Bulk Redirect List,并包含以下 URL 重定向:

    • Source URL(源 URL)https://example.com/
    • Target URL(目标 URL)https://example.co.uk/
    • Subpath matching(子路径匹配):已启用
    • Preserve query string(保留查询字符串):已启用
  2. 创建一条启用上述 Bulk Redirect List 的 Bulk Redirect Rule,并将规则表达式设置为如下:

    ip.src.country == "GB" and http.request.full_uri in $uk_redirect_list

此配置将对英国访问者执行以下重定向:

请求 URL 重定向后的 URL
https://example.com/ https://example.co.uk/
https://example.com/my/path/to/page.htm https://example.co.uk/my/path/to/page.htm
https://example.com/search?q=term https://example.co.uk/search?q=term

这篇文档对您有帮助吗?