{
  "id": "03",
  "content": [
    {
      "type": "heading",
      "text": "Redirects: 301/302 & Canonical URLs"
    },
    {
      "type": "text",
      "html": "Use simple <code>Redirect</code> for one\u2011to\u2011one mappings; use RewriteRule for patterns."
    },
    {
      "type": "text",
      "html": "<pre><code># Permanent redirect (301)\nRedirect 301 /old-page https://www.sampleaddress.com/new-page\n\n# Temporary (302)\nRedirect 302 /promo https://www.sampleaddress.com/summer-2025\n\n# Force one canonical host (www \u2192 non-www)\nRewriteEngine On\nRewriteCond %{HTTP_HOST} ^www\\.sampleaddress\\.com$ [NC]\nRewriteRule ^(.*)$ https://sampleaddress.com/$1 [R=301,L]</code></pre>"
    },
    {
      "type": "text",
      "html": "Tip: prefer 301 for permanent moves; 302 when only temporary."
    }
  ],
  "quiz": {
    "questions": [
      {
        "id": "q1",
        "type": "single",
        "text": "Which status code is best for a permanent move?",
        "options": [
          {
            "id": "a",
            "text": "301"
          },
          {
            "id": "b",
            "text": "302"
          },
          {
            "id": "c",
            "text": "404"
          }
        ],
        "correct": [
          "a"
        ]
      },
      {
        "id": "q2",
        "type": "single",
        "text": "A canonical redirect helps:",
        "options": [
          {
            "id": "a",
            "text": "Consolidate duplicate hosts/URLs"
          },
          {
            "id": "b",
            "text": "Generate sitemaps"
          },
          {
            "id": "c",
            "text": "Compress images"
          }
        ],
        "correct": [
          "a"
        ]
      }
    ]
  }
}