最近有需求将 INX Git 上的内容转到微信,鉴于微信及其积极的扫描政策,我决定主动屏蔽微信来避免潜在的风险。
Blog 端规则
首先,由于我有博客,所以我索性就直接托管在这里了,毕竟进行 CVS 之类的很方便。
创建一个 wechat.html
。随便写点内容,例如,你可以看看我的超简陋版。
随后,在 _config.yml
中,include
字段下加入 wechat.html
, skip_render
字段下加入wechat.html
。
随后正常部署即可。
Cloudflare 端规则
由于我的博客使用 Cloudflare,因此可以直接创建一条重定向规则,其中条件为
1 | (http.user_agent contains "MicroMessenger" and http.request.full_uri ne "https://inx.wf/wechat.html") or (http.user_agent wildcard r"MicroMessenger|WeiXin" and http.request.full_uri ne "https://inx.wf/wechat.html") |
动作为静态301跳转到 https://inx.wf/wechat.html
缺陷
没法实现单击“在浏览器中打开”就回到原内容。