简体   繁体   English

应该为WordPress网站添加哪些Cloudflare页面规则以仅在HTTPS裸(非www)URL上运行?

[英]What Cloudflare page rules should be added for a WordPress website to run on HTTPS naked (non www) URLs only?

Here is the existing configuration of my site: 这是我网站的现有配置:

  1. I have a CNAME record www to example.com in Cloudflare DNS settings. 我在Cloudflare DNS设置中有一个CNAME记录wwwexample.com
  2. Nothing in .htaccess of the original host server. 原始主机服务器的.htaccess中没有任何内容。
  3. WordPress site has its Website and Home address set to http://example.com WordPress网站的网站和家庭地址设置为http://example.com

I don't have a clear understanding of what Cloudflare does and how it integrates with WordPress. 我对Cloudflare的功能及其与WordPress的集成方式不甚了解。 However, I would like to achieve this without making any changes in WordPress. 但是,我想在不对WordPress进行任何更改的情况下实现这一目标。 What DNS and Page Rules combo should I configure in order to serve all the URLs ONLY over https without www ? 我应该配置什么DNS和页面规则组合才能仅通过https而不使用www来提供所有URL?

Based on this answer here , I tried changing my DNS settings but it didn't work. 根据此处的答案 ,我尝试更改DNS设置,但没有成功。 And I can't get my head around Cloudflare Page Rules. 而且我无法理解Cloudflare页面规则。

In order to accomplish this you should create two Page Rules. 为此,您应该创建两个页面规则。 One that redirects all traffic to https, and another that directs all www traffic to the root domain. 一种将所有流量重定向到https,另一种将所有www流量重定向到根域。

You can find directions for these Page Rules on this KB article (they are the first two). 您可以在此知识库文章中找到这些页面规则的说明 (它们是前两个)。 Or there is a video tutorial as well. 或者也有一个视频教程 If you are already maxed out on Page Rules there is also an option now to purchase additional rules without changing plans. 如果您已经对“页面规则”非常满意,现在还可以选择购买其他规则,而无需更改计划。

(I'm from Cloudflare) (我来自Cloudflare)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在WordPress中将.htaccess用于https和www到非www - .htaccess in Wordpress for https and www to non-www 如何执行301从非https www重定向页面。 html网页到WordPress网站,且没有https和www,URL中的关键字完全不同? - How to do 301 redirects on pages from non https www. html pages to a WordPress site with https and no www AND totally different keywords in URLs? 对于多站点 Wordpress,我如何将所有 URL 重定向到 www,并且仅将特定 URL 重定向到 https - How Can I Redirect ALL URLs to www and only specific URLs to https for Multisite Wordpress WordPress的裸域与www - wordpress naked domain vs www wordpress htaccess http www重定向到https non-www - wordpress htaccess http www redirect to https non-www 在cloudflare之后,wordpress网站管理员登录无法在https上运行 - wordpress website admin login not working on https after cloudflare 带有Cloudflare Flexible的WordPress HTTPS - WordPress HTTPS with Cloudflare Flexible 在 WordPress 和非 WordPress 子目录中强制 https+www - Force https+www in WordPress and non-WordPress subdirectory 如何在我的 Wordpress 网站上将非 www 重定向到 www - How to redirect non-www to www on my Wordpress website Wordpress多站点强制使用域HTTPS和WWW,仅使用HTTPS子站点HTACESS - Wordpress multisite Force HTTPS and WWW for domain and only HTTPS for subdomains HTACESS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM