GitHub Pages 301 Redirect HTML Builder

GitHub Pages doesn't support server-side redirects — you ship static files. The standard workaround is an HTML page with meta-refresh + canonical + JS redirect. This builder generates that HTML for any old → new URL pair.

How to use the GitHub Pages 301 Redirect HTML Builder

Enter the target URL to redirect to and an optional title shown briefly during the hop. Copy the generated HTML, or download it as index.html and place it at the old path in your repo. Visitors are forwarded by meta-refresh, canonical link, and a JavaScript fallback.

Redirecting on a static host

GitHub Pages, and static hosts like it, serve files and nothing else — there is no server to issue a real 301 when a page moves. The common workaround is a small HTML page at the old path that sends visitors onward three ways at once: a meta-refresh tag, a canonical link for search engines, and a JavaScript fallback. Hand-writing that markup for every moved URL is tedious and easy to get subtly wrong.

This generates that redirect page for any target URL — meta-refresh, canonical, and JS in one file you save as index.html at the old location. It is the static-host answer; on a server that supports real redirects an .htaccess 301 is cleaner, which the .htaccess generator produces, and to choose between a permanent and temporary redirect, the HTTP status cheat sheet explains 301 versus 302.

Common use cases

  • Moved a page — keep an old GitHub Pages URL working after restructuring.
  • Custom-domain switch — point old paths at a new domain.
  • Link preservation — stop external links to an old URL from 404ing.
  • Jekyll sites — pair with the jekyll-redirect-from pattern for moved posts.
  • Project rename — redirect the old project-pages path to the new one.

Frequently asked questions

Why not a real 301?

GitHub Pages serves static files with no server-side redirect support, so an HTML meta-refresh page is the standard substitute.

Is this good for SEO?

The canonical link tells search engines the true destination; it is weaker than a server 301 but the best a static host allows.

Where do I put the file?

Save it as index.html at the old path so requests to that path load the redirect.

What if I have a real server?

Use a proper 301 — the .htaccess generator writes one for Apache; see the HTTP status cheat sheet for 301 vs 302.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: