[Misc] Use the edge rule configuration for storing and hosting static sites with Youchu Cloud and similar services
This article shares the edge rule configuration used by this site for using Yukao Cloud for storage and hosting static sites
Below is the edge rule configuration used:

This description: Access domain domain.com is automatically converted to www.domain.com , force to https
规则名称:转WWW
使用方式:编程模式
URI 字符串提取:留空
规则编辑器:
# 裸域名跳转www
$WHEN($EQ($_HOST,cnsam.com))$REDIRECT(https://www.cnsam.com$_URI,301)
# http强制跳转https
$WHEN($EQ($_SCHEME,http))$REDIRECT(https://$_HOST$_URI,301)
优先级:1
break:勾选
规则状态:启用

This description: Some themes of HUGO static pages have 404 if no slash, add slash
规则名称:补斜杠-1
使用方式:通用模式
条件判断:请求 URI 正则匹配(不区分大小写) 匹配值:^(/[^.]+[^/])$
功能选择:边缘重定向
响应状态码:301
URI 字符串提取(可选):留空
重定向地址:$_URI/
优先级:2
break:不勾选
规则状态:启用

This description: Same as above, fix 404, add/index.html
规则名称:补斜杠-2
使用方式:通用模式
条件判断:请求 URI 正则匹配(不区分大小写) 匹配值:^(/[^?#]+)/$
功能选择:URL改写 URI字符串提取(可选):留空 改写规则:$1/index.html
优先级:3
break:不勾选
规则状态:启用
Sam (卅木) 原创,转载请注明出处。
如有侵权内容,请联系删除。
联系邮箱:blog#cnsam.com(# 替换为 @)
如有侵权内容,请联系删除。
联系邮箱:blog#cnsam.com(# 替换为 @)

