{
  "id": "07",
  "content": [
    {
      "type": "heading",
      "text": "Force HTTPS & Enable HSTS"
    },
    {
      "type": "text",
      "html": "Redirect all HTTP requests to HTTPS and add HSTS for extra security (served only over HTTPS)."
    },
    {
      "type": "text",
      "html": "<pre><code>RewriteEngine On\nRewriteCond %{HTTPS} !=on\nRewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]\n\n# HSTS (set only on HTTPS responses)\n&lt;IfModule mod_headers.c&gt;\nHeader always set Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\"\n&lt;/IfModule&gt;</code></pre>"
    }
  ],
  "quiz": {
    "questions": [
      {
        "id": "q1",
        "type": "single",
        "text": "What does HSTS do?",
        "options": [
          {
            "id": "a",
            "text": "Forces browsers to use HTTPS for a period"
          },
          {
            "id": "b",
            "text": "Enables gzip"
          },
          {
            "id": "c",
            "text": "Blocks all cookies"
          }
        ],
        "correct": [
          "a"
        ]
      },
      {
        "id": "q2",
        "type": "single",
        "text": "Where should HSTS be served from?",
        "options": [
          {
            "id": "a",
            "text": "Plain HTTP only"
          },
          {
            "id": "b",
            "text": "HTTPS responses"
          },
          {
            "id": "c",
            "text": "FTP"
          }
        ],
        "correct": [
          "b"
        ]
      }
    ]
  }
}