跳到正文
Skillpedia
安全75k · #2878

https-downgrade

它能做什么

这项技能检查安全网站的链接和资源地址中是否有普通的 http 网址。适用于正在将网站迁移到 HTTPS 的开发者和网站所有者。

适用场景

  • ✓当你把网站迁移到 HTTPS,而旧链接仍使用 http 的时候。
  • ✓当浏览器就你页面上的混合内容发出警告的时候。
  • ✓当模板中的硬编码地址使用 http 而不是 https 的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/https-downgrade/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/https-downgrade/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请找出我的 HTTPS 网站上仍指向 http 地址的链接。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会扫描链接和资源标签中的 http 地址。它会建议把内部链接改为相对路径或 https 路径,并检查外部网站是否支持 HTTPS。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Do not link from HTTPS to HTTP

Linking from a secure HTTPS page to an HTTP destination creates a mixed content situation that browsers warn users about or block entirely. It also means the linked page does not receive the ranking signal passed through the HTTPS referrer. For internal links, it can cause redirect loops or broken navigation.

Quick Reference

  • All internal links on an HTTPS page must point to HTTPS URLs — HTTP links trigger mixed content warnings
  • External links to HTTP destinations break the security chain and may be blocked by browsers
  • Use protocol-relative URLs (//example.com) or absolute HTTPS URLs — never hardcode http:// for internal links

Check

On pages served over HTTPS, scan all <a href> attributes for URLs starting with http:// (not https://). Flag: (1) Internal links using http:// that should use https:// or a relative path. (2) External links to third-party sites still on HTTP (flag for review — the destination may not support HTTPS). (3) Resource links (<img src>, <script src>, <link href>) pointing to HTTP URLs — these cause active mixed content warnings.

Fix

  1. Audit all <a href> values in templates and content for http:// links.
  2. For internal links: change http://yourdomain.com/path to /path (relative) or https://yourdomain.com/path.
  3. For external links: check if the destination supports HTTPS; update to https:// if so.
  4. For resource links (scripts, styles, images): always use https:// or protocol-relative //.
  5. In your CMS or database: run a search-and-replace to update stored HTTP URLs to HTTPS.
  6. Set up a server-level redirect from HTTP to HTTPS to catch any remaining HTTP URLs in user-generated content.
  7. Verify with: grep -r 'href="http://' ./templates/ or use a link auditing tool.

Explain

HTTPS is a confirmed Google ranking factor. When an HTTPS page links to HTTP resources or destinations, it downgrades the secure context, triggering browser warnings and potentially blocking content. For internal links, HTTP destinations mean an extra redirect (HTTP→HTTPS) on every navigation, slowing page loads. The ranking signal passed via the link's referrer is also diminished when crossing from HTTPS to HTTP.

Code Review

Parse all <a href>, <img src>, <script src>, and <link href> attributes. Flag any value starting with http:// (not https:// or a relative path). In JavaScript frameworks, also check for http:// in fetch(), axios, or router navigation calls. Report the count of HTTP links by category (internal, external, resource).


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/https-downgrade

常见问题

什么是混合内容?

当安全页面加载或链接到不安全的 http 资源时,浏览器可能会发出警告或拦截。

哪些链接最紧急?

这项技能指出,带有 http 地址的图片、脚本和样式表会引发主动警告,因此最为重要。

对于不支持 HTTPS 的外部网站怎么办?

这项技能指出,应先检查目标网站是否支持 HTTPS,并在修改链接前进行确认。

详情

作者的原始描述

Use when auditing a site's internal and external links for protocol consistency, migrating a site from HTTP to HTTPS, or reviewing hardcoded URLs in a codebase that may use `http://` instead of `https://`.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2878
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能