WordPress的Cloudflare页面规则

cloudflare
Cloudflare页面规则

Cloudflare CDN在此博客上处于活动状态。

Cloudflare页面规则

页面规则1

使用此规则将www重定向到裸域。

  • * www.your-site.com / *
  • 转发网址
  • 301 –永久重定向
  • https://your-site.com / $ 2

可以创建类似的规则将裸域重定向到www。

 

页面规则2

使用此规则可以保护XML-RPC文件。

仅当您不使用WordPress移动应用程序或不通过电子邮件发布内容时,才添加此规则。

  • https://your-site.com/xmlrpc.php
  • 转发网址
  • 301 –永久重定向
  • https://your-site.com/

页面规则3

此规则适用于“预览”页面。

  • https://your-site.com/*preview=true*
  • 缓存级别–绕过
  • 原始缓存控制打开

页面规则4

使用此页面规则搜索页面。

  • https://your-site.com/?s=*
  • 浏览器完整性检查
  • 缓存级别–绕过
  • 原始缓存控制打开

页面规则5

将此页面规则用于Feed页面。

  • https://your-site.com/feed*
  • 缓存级别–绕过
  • 原始缓存控制打开

页面规则6

将此页面规则用于Sitemaps页面。

  • https://your-site.com/sitemap*
  • 缓存级别–绕过
  • 原始缓存控制打开

页面规则7

将此页面规则用于wp-admin。

  • https://your-site.com/wp-admin*
  • 浏览器完整性检查
  • 缓存级别-标准
  • 原始缓存控制打开

页面规则8

将此页面规则用于wp-includes。

  • https://your-site.com/wp-includes*
  • 浏览器完整性检查
  • 缓存级别-标准
  • 原始缓存控制打开

页面规则9

将此页面规则用于wp-content。

  • https://your-site.com/wp-content*
  • 浏览器完整性检查
  • 缓存级别-标准
  • 原始缓存控制打开

页面规则10

将此页面规则用于wp-json。

  • https://your-site.com/wp-json*
  • 浏览器完整性检查
  • 原始缓存控制打开
  • 缓存级别-标准

页面规则11

将此页面规则用于rest_route。

  • https://your-site.com/rest_route*
  • 浏览器完整性检查
  • 原始缓存控制打开
  • 缓存级别-标准

页面规则12

使用此页面规则处理重要页面,例如关于,联系方式,条款等…

  • https://your-site.com/about/
  • 缓存级别–缓存所有内容
  • 边缘缓存TTL –一个月
  • 原始缓存控制打开
  • 永远在线

页面规则13

其余页面使用此规则。

  • https://your-site.com/*
  • 缓存级别–缓存所有内容
  • 边缘缓存TTL –一天
  • 原始缓存控制打开

以上页面规则仅是示例。

相关文章