简体   繁体   中英

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.
  2. Nothing in .htaccess of the original host server.
  3. WordPress site has its Website and Home address set to http://example.com

I don't have a clear understanding of what Cloudflare does and how it integrates with WordPress. However, I would like to achieve this without making any changes in WordPress. What DNS and Page Rules combo should I configure in order to serve all the URLs ONLY over https without www ?

Based on this answer here , I tried changing my DNS settings but it didn't work. And I can't get my head around Cloudflare Page Rules.

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM