本文へスキップ
Skillpedia
セキュリティ75k · #2876

http-to-https

できること

このスキルは、ウェブサーバーが平文の HTTP の訪問を、安全な HTTPS のアドレスに送っているかを確認します。ウェブサイトを運営するサイト運営者や開発者向けです。

使う場面

  • ✓訪問者が https を付けずにドメインを入力し、安全でない版に着くとき。
  • ✓古いリンクがまだ平文の http のアドレスを指しているとき。
  • ✓新しいサーバーやホスティングの会社を設定するとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/http-to-https/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のウェブサイトは、すべての http の訪問を https にリダイレクトするようにしてもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、平文のアドレスが、パスを保ったまま、対応する HTTPS のアドレスへの 301 リダイレクトを返すかを確認します。サーバーまたは CDN のレベルで設定し、コマンドラインのリクエストでテストすることを提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Redirect HTTP to HTTPS

Without an HTTP-to-HTTPS redirect, users who type the domain without https:// or follow old links land on the insecure version of the site, exposing session cookies and form data to network attackers.

Quick Reference

  • Redirect http://example.com to https://example.com with HTTP 301 (permanent redirect)
  • Preserve the full path and query string in the redirect: https://$host$request_uri
  • Use 301 (not 302) so browsers and search engines cache the redirect and future requests go directly to HTTPS
  • Configure redirects at the server/CDN level — never rely on client-side JavaScript for security redirects
  • After validating HTTPS works, add HSTS to eliminate future HTTP requests entirely

Check

Test whether http://example.com redirects to https://example.com with a 301 status code. Check that the full URL path and query string are preserved in the redirect Location header.

Fix

Configure the web server to redirect all HTTP requests to HTTPS with a 301 status code, preserving the full request path. Verify the redirect with curl -I http://example.com.

Explain

Explain why redirecting HTTP to HTTPS is necessary, the difference between 301 and 302 redirects, and how HSTS can eliminate the redirect for returning users.

Code Review

Review server config, headers, forms, and integration points related to Redirect HTTP to HTTPS. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


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

Rule page: https://frontendchecklist.io/rules/security/http-to-https

よくある質問

なぜ 302 ではなく 301 なのですか?

301 は恒久的なので、ブラウザや検索エンジンがそれをキャッシュし、以降は直接 HTTPS に行くからだとこのスキルは説明しています。

リダイレクトを JavaScript で行うべきですか?

いいえ。セキュリティのリダイレクトは、クライアント側のコードではなく、サーバーか CDN で設定すべきだとこのスキルは説明しています。

リダイレクトの設定後は何をしますか?

将来の平文の HTTP のリクエストを止めるため、HSTS を追加することを提案しています。

詳細

作者による元の説明

Use when checking whether a web server is configured to redirect all HTTP traffic to HTTPS.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2876
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル