HSTS: HTTP Strict Transport Security 向けに SEO

何 HSTS 実際に する, Strict-Transport-Security header syntax (max-age, includeSubDomains, preload), ブラウザー-だけ internal redirect crawlers 決して see, なぜ それ doesn't replace あなたの 301s, と どのように preload できる lock あなた in — から Patrick Stox.

初回公開:2026年7月3日 · 最終更新:2026年8月3日 · Advanced
言語
このページには証拠シグナルが1件あります

HSTS (HTTP Strict Transport Security) は Strict-Transport-Security レスポンス header — honored だけ いつ それ arrives over secure connection — その tells ブラウザー to 常に 使う HTTPS 向けに あなたの domain going forward, closing insecure gap その 新しい 訪問者's 最初の リクエスト それでも makes over HTTP 前に あなたの 301 fires. それ's ブラウザー-layer, per-クライアント ポリシー on top of あなたの サーバー-side redirects, ない replacement: RFC 6797 持つ ブラウザー rewrite URI to HTTPS internally 前に いずれかの リクエスト goes out (多くの場合 表示された as internal 307-style redirect, though RFC doesn't mandate specific status code), so no サーバー ever sees HTTP form と crawlers それでも 必要とする あなたの real 301 to understand 移行 と carry リンク equity. header 持つ 3つの directives — max-age (required), includeSubDomains, と preload. Preload bakes あなたの domain へ ブラウザー itself via hstspreload.org (requiring max-age of at least year, includeSubDomains, と preload flag) と は close to irreversible — removal は 分離する submission その takes months to reach ユーザー. HSTS は また deliberately unforgiving: ブラウザー その knows あなた as HSTS ホスト する hard-fail とともに no click-通じて もし あなたの certificate ever breaks. So enable それ だけ once HTTPS は genuinely solid 全体で すべての subdomain, と treat preload as 1つの-方法 door.

TL;DR — HSTS は Strict-Transport-Security レスポンス header, honored だけ いつ ブラウザー receives それ over secure connection, と stored per-クライアント as future ポリシー 向けに その ホスト. それ closes “first request problem” 301 alone leaves open: initial HTTP リクエスト から 新しい 訪問者 は insecure until > redirect fires, と その’s window SSL-stripping attacker wants. 3つの directives: max-age (required, seconds), includeSubDomains, preload. いつ > ブラウザー enforces HSTS それ rewrites URI to HTTPS internally, 前に いずれかの リクエスト reaches サーバー — RFC 6797 doesn’t mandate specific status code 向けに その rewrite, though tools 多くの場合 surface それ as 307 — so あなたの サーバー-side 301s は それでも mandatory 向けに 検索 エンジン と リンク equity; HSTS は on top of それらを, ない instead. Preload bakes あなたの domain へ ブラウザー via hstspreload.org (必要とする max-age ≥ 31536000, includeSubDomains, と preload) と は close to irreversible — removal は 分離する submission その takes months to reach ユーザー. と HSTS は designed to hard-fail on いずれかの cert エラー, so enable それ だけ いつ HTTPS は robust 全体で すべての subdomain.

“first request problem”(日本語訳:引用内容を日本語で示します)

HTTPS hub introduces HSTS as ブラウザー-layer protection その sits on top of あなたの 301s. この ページ は deep dive: exact header syntax, internal redirect その trips SEOs up, preload list’s near-irreversibility, と real-world 方法 HSTS locks people out.

問題 HSTS 実際に solves: 最初の リクエスト

Picture properly migrated site. すべての http:// URL 301-redirects to その https:// twin, certificate は valid, canonical point to HTTPS. 見える airtight. それ isn’t, quite.

いつ brand-新しい 訪問者 タイプ yoursite.com (no scheme) または clicks 旧 http://yoursite.com リンク, ブラウザー’s 最初の リクエスト goes out over plain HTTP. あなたの サーバー 回答 とともに 301, と すべての リクエスト 後に その は secure. But その 1つの initial round-trip happened in clear — と その’s exactly window SSL-stripping attacker on same network wants. それら intercept HTTP リクエスト, 保つ victim on HTTP 一方で それら proxy HTTPS to あなたの サーバー, と read または rewrite everything.

HSTS eliminates その window 向けに anyone who 持つ visited 前に. web.dev は direct について mechanism: “use Strict Transport Security to tell clients they should always connect to your server using HTTPS, even when following an http:// reference. This defeats attacks like SSL Stripping, and avoids the round-trip cost of the 301 redirect.” (web.dev). その last clause 重要である 向けに performance too: returning ブラウザー skips HTTP→HTTPS round-trip entirely. Evidence for this claim After receiving HSTS, a browser upgrades future HTTP attempts to HTTPS before sending the request. Scope: MDN documents user-agent enforcement after the header has been learned; first-visit protection requires preload or a prior secure visit. Confidence: high · Verified: MDN: Strict-Transport-Security header

“use Strict Transport Security to tell clients they should always connect to your server using HTTPS, even when following an http:// reference. This defeats attacks like SSL Stripping, and avoids the round-trip cost of the 301 redirect.”(日本語訳:引用内容を日本語で示します) “hsts-browser-upgrade”(日本語訳:引用内容を日本語で示します)

2つの boundary conditions worth being precise について. 最初の, HSTS は stored, per-クライアント ポリシー — それ lives in その 1つの ブラウザー’s own state 向けに その ホスト, learned から header 配信された over secure connection; same header sent on HTTP レスポンス は ignored outright ( attacker who できる inject または strip headers on plain HTTP できる otherwise neutralize それ), と クライアント その 持つ 決して received それ — 新鮮 install, 異なる ブラウザー, crawler — 持つ no ポリシー to enforce. Second, rewrite は scheme-と-port aware: implicit port 80 リクエスト becomes implicit port 443 リクエスト, but もし original URI named explicit non-default port, ブラウザー 保つ その same port number と simply contacts それ over HTTPS instead.

header syntax

HSTS は 1つの レスポンス header とともに up to 3つの directives. Per MDN, forms は:

Strict-Transport-Security: max-age=31536000
Strict-Transport-Security: max-age=31536000; includeSubDomains
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
  • max-age=<seconds> — required. “The time, in seconds, that the browser should remember that a host is only to be accessed using HTTPS” (MDN). 31536000 は 1つの year; 63072000 は 2つの. clock resets on すべての レスポンス その carries header, so active site continually renews その ポリシー. この は relative, per-クライアント state: simply removing header doesn’t immediately clear それ — ブラウザー その already learned ポリシー 保つ enforcing それ until その stored max-age runs out. To turn HSTS off 向けに クライアント その already learned それ, あなた 持つ to actively 配信する max-age=0 over secure レスポンス; ブラウザー その後 forgets ポリシー on その next secure visit. (max-age=0 clears learned ポリシー だけ — それ する ない remove domain から 分離する preload list.)
  • includeSubDomains — optional. “If this directive is specified, the HSTS policy applies to all subdomains of the host’s domain as well” (MDN). Powerful と dangerous in equal measure — see lockout scenarios below.
  • preload — optional. flag その シグナル あなたの 意図 to be on ブラウザー preload list. それ する nothing on その own; それ’s prerequisite 向けに submitting to hstspreload.org. Evidence for this claim HSTS preload requires at least a one-year max-age, includeSubDomains, and preload; removal can take months to reach users. Scope: The Chromium preload service documents submission and removal behavior; requirements can change and should be rechecked before submission. Confidence: high · Verified: Chromium: HSTS Preload List Submission

“The time, in seconds, that the browser should remember that a host is only to be accessed using HTTPS”(日本語訳:引用内容を日本語で示します) “If this directive is specified, the HSTS policy applies to all subdomains of the host’s domain as well”(日本語訳:引用内容を日本語で示します) “hsts-preload-requirements-removal”(日本語訳:引用内容を日本語で示します)

behavior, again から MDN: “Before loading an http URL, the browser checks the domain name against its HSTS hosts list. If the domain name is a case insensitive match for an HSTS host or is a subdomain of one that specified includeSubDomains, then the browser replaces the URL scheme with https.”

“Before loading an http URL, the browser checks the domain name against its HSTS hosts list. If the domain name is a case insensitive match for an HSTS host or is a subdomain of one that specified includeSubDomains, then the browser replaces the URL scheme with https.”(日本語訳:引用内容を日本語で示します)

internal upgrade crawlers 決して see (この は SEO crux)

Here’s single 大半の misunderstood thing について HSTS, と 理由 それ できる’t replace あなたの redirects.

いつ ブラウザー upgrades http:// リクエスト under HSTS, それ rewrites URI to HTTPS internally, 前に いずれかの network リクエスト は made — RFC 6797 必要とする scheme substitution itself but する ない mandate particular status code 向けに それ (RFC 6797 §8,3), so given ブラウザー または crawling tool 可能性がある represent その internal step however それ likes — 多くの 表示 それ as internal 307, but その’s クライアント/tool-specific, ない protocol guarantee. 何 重要である 向けに SEO は simpler と holds regardless of label: no サーバー は contacted 向けに HTTP version, so no crawler ever sees それ. Googlebot と Bingbot don’t carry learned HSTS ポリシー around 方法 returning human’s Chrome する — それら hit あなたの サーバー 新鮮, と 何 それら 必要とする to see そこ は real, サーバー-side 301. Evidence for this claim RFC 6797 requires the user agent to rewrite a known-HSTS-host HTTP URI to HTTPS internally, but does not mandate any specific redirect status code for that internal rewrite; how a given browser or crawling tool represents that step (e.g., as an internal 307) is a client/tool implementation detail, not a protocol requirement. Scope: RFC 6797 Section 8.3 ("URI Loading and Port Mapping") specifies the UA MUST replace the URI scheme with https; it does not prescribe an HTTP status code for that internal substitution, since no HTTP exchange occurs for it. Section 7.2's suggestion of status code 301 addresses ordinary server-side redirect behavior, not this internal client-side rewrite. Confidence: high · Verified: RFC 6797 §8.3 — URI Loading and Port Mapping

“hsts-internal-redirect-representation”(日本語訳:引用内容を日本語で示します)

So ルール は blunt: HSTS する ない replace あなたの サーバー-side 301s. 301 は 何 検索 エンジン 使う to understand protocol 移行 と to consolidate シグナル (301 と other permanent redirects don’t 引き起こす loss in PageRank, per Google). ブラウザー-だけ internal upgrade は ユーザー-experience と security layer on top. あなた 必要とする 両方, doing 異なる jobs:

  • 301 (サーバー-side): 向けに crawlers, インデックス登録, と リンク equity.
  • Internal 307-style upgrade (ブラウザー-side, から HSTS): 向けに returning humans と SSL-stripping protection — exact status representation varies by クライアント/tool.

いずれかの guide その tells あなた HSTS “handles the redirect so you can drop your 301” は 誤った in 方法 その する quietly cost あなた.

“handles the redirect so you can drop your 301”(日本語訳:引用内容を日本語で示します)

HSTS preload: near-permanent version

max-age protects returning 訪問者, but それ 持つ bootstrap 問題: 最初の-time 訪問者 who 持つ 決して received あなたの header は それでも exposed on その initial リクエスト. Preload solves それ by hardcoding あなたの domain へ ブラウザー’s ソース itself, so ブラウザー knows あなた’re HTTPS-だけ 前に それ 持つ ever connected.

あなた opt in at hstspreload.org. requirements は exact:

  1. “Serve a valid certificate.”
  2. “Redirect from HTTP to HTTPS on the same host, if you are listening on port 80.”
  3. “Serve all subdomains over HTTPS” — including in particular www subdomain もし DNS record exists.
  4. On base domain’s HTTPS レスポンス, HSTS header どこ “the max-age must be at least 31536000 seconds (1 year),” “the includeSubDomains directive must be specified,”“the preload directive must be specified.” (hstspreload.org)

“Serve a valid certificate.”(日本語訳:引用内容を日本語で示します) “Redirect from HTTP to HTTPS on the same host, if you are listening on port 80.”(日本語訳:引用内容を日本語で示します) “Serve all subdomains over HTTPS”(日本語訳:引用内容を日本語で示します) “the max-age must be at least 31536000 seconds (1 year),“(日本語訳:引用内容を日本語で示します) “the includeSubDomains directive must be specified,“(日本語訳:引用内容を日本語で示します) “the preload directive must be specified.”(日本語訳:引用内容を日本語で示します)

その’s なぜ 2つの-year example above (max-age=63072000; includeSubDomains; preload) は shape people submit — note これらの は exact submission requirements as 公開された by hstspreload.org; treat それらを as 現在の bar, ない permanent constant, と re-確認 live ページ 前に あなた submit.

それ helps to 保つ four distinct states straight, since people conflate それらを constantly:

State何’s 実際に true
Token presentあなたの header includes preload. この は flag だけ — それ する nothing by itself と doesn’t put あなた on いずれかの list.
Eligibleあなたの site meets すべての four hstspreload.org requirements above (cert, redirect, subdomains, header shape). それでも ない on list.
Submitted / pendingあなた’ve submitted at hstspreload.org と それ’s queued 向けに inclusion in upcoming ブラウザー release. ない yet enforced 向けに real ユーザー.
実際に listeddomain は baked へ given ブラウザー’s shipped 構築する. Enforcement だけ exists 向けに ユーザー on その 構築する — rollout isn’t instant または universal 全体で ブラウザー.

Removal runs same four states in reverse, と 単に as slowly: removing preload directive から あなたの header makes あなた eligible 向けに removal form, その後 submission は pending, と domain stays enforced 向けに いずれかの ユーザー on ブラウザー 構築する その それでも ships それ — until その 構築する cycles out.

Now 部分 その turns preload へ 1つの-方法 door. から submission site itself: “Be aware that inclusion in the preload list cannot easily be undone. Domains can be removed, but it takes months for a change to reach users with a Chrome update and we cannot make guarantees about other browsers.” (hstspreload.org). と その own advice: “Don’t request inclusion unless you’re sure that you can support HTTPS for your entire site and all its subdomains in the long term.”

“Be aware that inclusion in the preload list cannot easily be undone. Domains can be removed, but it takes months for a change to reach users with a Chrome update and we cannot make guarantees about other browsers.”(日本語訳:引用内容を日本語で示します) “Don’t request inclusion unless you’re sure that you can support HTTPS for your entire site and all its subdomains in the long term.”(日本語訳:引用内容を日本語で示します)

Practical translation: preload は genuinely great security posture, but もし あなた ever 必要とする to 配信する anything — legacy subdomain, acquired brand, internal tool — over plain HTTP again, あなた’re stuck waiting on ブラウザー release cycles to reach すべての ユーザー. Kinsta’s guide puts operational reality plainly: それ できる be difficult と time-consuming process to 得る あなたの domain removed. Treat preload as permanent.

なぜ HSTS は designed to hurt いつ things break

HSTS’s strictness は ない bug — それ’s entire security guarantee. web.dev spells out tradeoff: “Clients that have listed your site as a known HSTS Host are likely to hard-fail if your site ever has an error in its TLS configuration, (such as an expired certificate). HSTS is explicitly designed this way to ensure that network attackers can’t trick clients into accessing the site without HTTPS.” (web.dev).

“Clients that have listed your site as a known HSTS Host are likely to hard-fail if your site ever has an error in its TLS configuration, (such as an expired certificate). HSTS is explicitly designed this way to ensure that network attackers can’t trick clients into accessing the site without HTTPS.”(日本語訳:引用内容を日本語で示します)

conclusion Google draws は sentence I’d tattoo on anyone について to flip この on: “Don’t enable HSTS until you’re certain your site operation is robust enough to avoid ever deploying HTTPS with certificate validation errors.” (web.dev).

“Don’t enable HSTS until you’re certain your site operation is robust enough to avoid ever deploying HTTPS with certificate validation errors.”(日本語訳:引用内容を日本語で示します)

“Hard-fail” 意味する exactly その: no “proceed anyway” リンク, no click-通じて. On normal HTTPS ページ, expired cert throws scary interstitial その determined ユーザー できる bypass. On HSTS ホスト, ブラウザー refuses outright. So failure mode of missed certificate renewal 変更 category — から “traffic dips because people are scared off” to “the site is unreachable for every returning visitor.”

“traffic dips because people are scared off”(日本語訳:引用内容を日本語で示します) “the site is unreachable for every returning visitor.”(日本語訳:引用内容を日本語で示します)

Real-world lockout scenarios(日本語訳)

方法 HSTS bites in practice almost 常に trace back to includeSubDomains または preload getting ahead of あなたの actual HTTPS coverage:

  • ** forgotten subdomain.** あなた set includeSubDomains on example.com, but legacy.example.com ( 旧 app, status ページ, vendor tool) だけ speaks HTTP または 持つ cert その doesn’t cover それ. すべての ブラウザー その saw header now refuses to load その subdomain. Nothing 変更された on その サーバー — ポリシー reached down と broke それ.
  • ** wildcard-cert gap.** *.example.com wildcard covers foo.example.com but ない foo.bar.example.com ( wildcard は 1つの DNS label deep). もし deeper subdomain relies on HTTP または mismatched cert, includeSubDomains locks それ out.
  • ** expired cert on HSTS ホスト.** Renewal automation fails, cert lapses, と instead of bypassable warning あなた 得る site その’s down 向けに everyone whose ブラウザー remembers あなたの ポリシー — until あなた 得る valid cert back それら reconnect と receive 新鮮 secure レスポンス. そこ は no faster override.
  • Preload regret. あなた preloaded, その後 business 必要とする forces HTTP-だけ service under domain. Rolling その back は 2つの 分離する, non-instant jobs, ない 1つの: serving max-age=0 over HTTPS だけ clears learned ポリシー 向けに クライアント その reconnect 前に their 旧 max-age する’ve expired anyway, 一方で getting domain out of preload list は distinct submission その それでも takes ブラウザー release cycles — months — to reach ユーザー, independent of anything あなた 変更 on あなたの サーバー.
  • Local dev / staging collisions. Preloading example.com とともに includeSubDomains できる make dev.example.com または localhost-style internal ホスト under same apex refuse HTTP, breaking local ワークフロー in surprising 方法.

None of これらの は 理由 to avoid HSTS. それら’re 理由 to stage それ: short max-age 最初の, add includeSubDomains だけ 後に auditing すべての subdomain, と reserve preload 向けに いつ あなた’re certain.

HSTS は ない ranking play (と doesn’t touch canonicalization)

To be clear on SEO framing: HSTS は ない ranking シグナル. HTTPS itself は deliberately tiny 1つの — Google called それ “very lightweight signal” affecting fewer than 1% of クエリ — と HSTS は layer on top of HTTPS, ない 分離する ranking input. それ また doesn’t directly control canonicalization または インデックス登録. Google’s own documentation は より多くの specific than flat “doesn’t matter,” though: Google prefers HTTPS as canonical over equivalent HTTP ページ except いつ そこ’s invalid certificate, insecure ページ dependencies, HTTPS ページ その redirects to HTTP, または HTTP rel="canonical" tag (Google: consolidating duplicate URLs). HSTS cannot fix または override いずれかの of その. それ’s ブラウザー-side ポリシー とともに no influence on Google’s canonicalization logic — bad certificate または broken redirect chain できる それでも push Google toward HTTP canonical regardless of 何 あなたの HSTS header says. Canonicalization は driven by あなたの 301s, あなたの certificate, あなたの rel="canonical", と あなたの internal リンク — HSTS earns その place 向けに security, ユーザー trust, と closing SSL-stripping gap — する それ 向けに それらの 理由, 保つ あなたの 301s と certificate genuinely solid, と あなた’ll 決して see HSTS itself on rankings report either 方法.

“very lightweight signal”(日本語訳:引用内容を日本語で示します)

もし あなた’re running broader HTTP→HTTPS 移行, HSTS は last thing あなた switch on, ない 最初の — それ belongs 後に 移行 持つ settled, as 部分 of wider site 移行 discipline.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.