Skip to content

Hosting migration: convert meta-refresh aliases to server-side 301 redirects #1

Description

@anatoly314

Context

The site currently deploys to GitHub Pages, which cannot serve real HTTP redirects. All legacy-URL redirects work via client-side meta-refresh:

  1. Hugo aliases: frontmatter (generates meta-refresh stub pages), and
  2. one hand-written stub at static/docs/installation/desktop/index.html (needed because it targets an anchor fragment, which Hugo aliases can't do).

Meta-refresh is a weak canonicalization signal, so search engines tend to keep the old URLs indexed. When the site moves to its own hosting, we can and should serve proper 301 Moved Permanently responses instead.

Task

When migrating off GitHub Pages:

  • Convert the redirect table below into server-side 301 rules (nginx / Caddy / platform _redirects — whichever the new host uses), kept in version control in this repo, not only in a hosting dashboard.
  • Keep the Hugo aliases: frontmatter as the source of truth (harmless belt-and-suspenders; the server rules take precedence).
  • Preserve exact URL parity, including trailing-slash behavior (GitHub Pages serves /foo/index.html; the new host must not introduce /foo/foo/ redirect chains).
  • HTTPS from cutover; lower DNS TTL beforehand; ensure the GitHub Pages deployment is disabled (or 301s to the new host) so two live hosts never serve in parallel.
  • Verify missing pages return a real 404 status (not a 200 "soft 404").
  • After cutover: resubmit the sitemap in Google Search Console and monitor the Pages report for a few weeks. The domain property needs no re-verification.

Redirect table (current, from aliases: + static stub)

From To 301 status
/docs/installation/ /docs/how-to/
/docs/installation/desktop/ /docs/how-to/connect-claude/#claude-desktop fragment OK in Location header
/docs/installation/web/ /docs/how-to/connect-chatgpt-to-anki/
/docs/installation/mcp-clients/ /docs/how-to/connect-mcp-clients/
/docs/how-to/connect-claude-web/ /docs/how-to/connect-claude/
/docs/how-to/connect-claude-desktop/ /docs/how-to/connect-claude/
/docs/how-to/connect-claude-code/ /docs/how-to/connect-claude/
/docs/prompts/ /docs/how-to/anki-ai-prompts/
/docs/image-flashcards/ /docs/how-to/add-images-to-cards/
/docs/audio-flashcards/ /docs/how-to/add-audio-to-cards/
/docs/known-issues/ /docs/how-to/troubleshooting/
/docs/known-issues/viewing-notes-blocks-updates/ /docs/how-to/troubleshooting/
/docs/concepts/anki-on-premise/ /docs/hosted-anki/ added on docs-rewrite branch

Note: regenerate this table from the aliases: frontmatter at migration time in case more aliases were added since this issue was filed (grep -r "aliases:" content/).

Why it matters

Several of the legacy URLs above still receive meaningful organic search traffic. With meta-refresh they keep working for users, but proper 301s let search engines consolidate ranking signals onto the canonical pages and are the standard, safe way to preserve SEO through a hosting migration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions