跳转到内容
搜索文档

将请求重定向到另一个主机名

创建重定向规则,以将所有对 smallshop.example.com 的请求使用 HTTPS 重定向到另一个主机名,同时保留原始路径和查询字符串。

最后更新 查看 MarkdownAgent 设置

此单次重定向示例将所有对 smallshop.example.com 的请求使用 HTTPS 重定向到另一个主机名 globalstore.example.net,同时保留原始路径和查询字符串。

当传入请求匹配时

  • 通配符模式
    • 请求 URLhttp*://smallshop.example.com/*

  • 目标 URLhttps://globalstore.example.net/${2}
  • 状态码: 301
  • 保留查询字符串: 已启用

例如,该重定向规则将执行以下重定向:

请求 URL 目标 URL 状态码
http://smallshop.example.com/ https://globalstore.example.net/ 301
http://smallshop.example.com/admin/?logged_out=true https://globalstore.example.net/admin/?logged_out=true 301
https://smallshop.example.com/?all_items=1 https://globalstore.example.net/?all_items=1 301
http://example.com/about/ (未改变)

这篇文档对您有帮助吗?