使用cloudfare将所有路径重定向到另一个URL

时间:2020-08-20 11:54:53

标签: cdn cloudflare

我刚开始使用Cloudflare作为CDN。

我有两个域名分别为example.seexample.com的域,它们托管在一台具有相同数据的服务器中,两者都是同一站点。我想重定向所有路由,包含所有URL路径或查询字符串,从域结尾为.se到域结尾为.com。 例如:

example.se   -> example.com,
example.se/ca  -> example.com/ca,
example.se/ca/product  -> example.com/ca/product,
example.se/ca/product?test=1  -> example.com/ca/product?test=1

我使用“页面规则”部分并添加如下重定向规则:

example.se/*   

然后设置为:

forwarding url      & 301 permanent redirect

to : https://www.example.com/$1

但是有了这个规则,重定向才可以申请:

example.se   -> example.com

不适用于其他路线。 如果您有经验,请帮助我。

0 个答案:

没有答案
相关问题