gpt4 book ai didi

.htaccess - Cloudflare DNS - 如何将所有子域重定向到根域?

转载 作者:行者123 更新时间:2023-12-04 12:24:58 24 4
gpt4 key购买 nike

有人能告诉我如何将所有子域重定向到 Cloudflare DNS 中的根域吗?

我一直在寻找没有任何运气的一天。

不能使用 .htaccess因为所有子域都没有解析(它们看起来就像一个没有传播的根域)并且不返回任何内容,而且我不想为每个可能的子域设置数百条 DNS 记录。

我想设置一个通配符 dns 条目来重定向或至少使所有子域都可以访问,所以我可以通过 .htaccess 完成其余的工作,或通过 DNS。

那么如何为上述要求制作 DNS 条目?

谢谢。

最佳答案

来自支持:Does Cloudflare support wildcard DNS entries?

Cloudflare Free, Pro and Business plan:

We do not proxy wildcard records so these subdomains will be served directly without Cloudflare performance, security, or apps. The wildcard domain will have no cloud (orange or grey) on the Cloudflare DNS Settings page for that reason. If you are adding a * CNAME or A Record you need to make sure the record is grey clouded in order for the record to be created.

To get Cloudflare protection on a wildcard subdomain (for example: www), you explicitly have to define that record in your Cloudflare DNS settings. First, log into your Cloudflare account and select the DNS icon. In this example, you would add "www" as its own CNAME record on your Cloudflare DNS Settings page and toggle the cloud to orange so the Cloudflare's proxy is enabled.



除非您是 Enterprise 客户,否则您不能使用通配符通过 Cloudflare 进行重定向。

确保云标志为灰色以添加通配符记录:

Cloudflare DNS: CNAME * example.com

关于.htaccess - Cloudflare DNS - 如何将所有子域重定向到根域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45916550/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com