跳转到内容
搜索文档

将域名请求重定向到新域名

创建一条重定向规则,将某个域名的所有 URL 重定向到新域名的根路径,包括旧域名的任何子域名。 the root of a new domain, including any subdomains of the old domain.

最后更新 查看 MarkdownAgent 设置

在本示例中,旧网站已停用,并由位于不同域名上的新网站取代。功能已不同,所有 URL 现在都应指向新域名的根路径。旧域名的任何子域名同样适用。

使用以下配置创建一条重定向规则

当传入请求匹配时

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

然后

  • 目标 URLhttps://example.net/
  • 状态码: 301

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

请求 URL 目标 URL 状态码
http://example.com/ https://example.net/ 301
https://example.com/ https://example.net/ 301
https://subdomain.example.com/ https://example.net/ 301
https://example.com/my/path/to/page.htm https://example.net/ 301
https://example.com/search?q=term https://example.net/ 301

这篇文档对您有帮助吗?