Free auditStart free
GuideGhost · Redirects

Ghost redirects

Add Ghost 301 and 302 redirects by uploading redirects.yaml in Labs, write regex rules, avoid the tab and empty-file traps, and test them.

3 min
read
4
sources
Oct 29, 2026
updated
Scaplet Editorial Team
author
In one line

Ghost handles redirects with a redirects.yaml file. In Ghost Admin, go to Settings → Advanced → Labs, open the Beta features tab, download the current file, add rules under 301: or 302:, and upload it again. Indent with spaces, and never upload an empty file, which removes every existing redirect.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01What the Ghost docs state about redirects.yaml

The file and the format

Topic

Status codes

Documented behavior
301 (permanent) and 302 (temporary); the help article lists no others
Topic

Structure

Documented behavior
Two top-level keys, 301 and 302; each rule is /from: /to on its own indented line
Topic

Indentation

Documented behavior
"Be sure to use spaces and not tabs to indent rules."
Topic

Server location

Documented behavior
content/data/redirects.yaml; replace it there and restart Ghost for changes to take effect
Topic

Older JSON file

Documented behavior
"Both formats are still supported, but JSON support will be removed in a later version."
Topic

Destinations

Documented behavior
The tutorial says external destinations are allowed
redirects.yaml format, per Ghost's redirect docs
301:
  /old-postname/: /new-postname/
302:
  /temporary-redirect-from: /temporary-redirect-to

Ghost's developer docs say uploading through Ghost Admin is the recommended method, and that the same upload route covers routes.yaml. If you inherited a site from before Ghost 4.0, you may have redirects.json. It still works, but write new rules in YAML so you are not caught by the removal of JSON support.

02How it works

Upload steps

  1. 1

    Open Labs

    In Ghost Admin, go to Settings → Advanced → Labs, per Ghost's redirects help article. Use the Open/Close toggle to expand the Labs area.

  2. 2

    Download the current file first

    On the Beta features tab, download your existing redirects.yaml. Edit that copy rather than starting a new one, since Ghost's tutorial notes that an empty upload removes every redirect.

  3. 3

    Add rules and save with spaces

    Open the file in a code editor and add rules under 301: or 302:. Use a 301 for a move you do not plan to undo and a 302 for a temporary one. Google says to use a permanent redirect when you are sure it won't be reverted.

  4. 4

    Upload and test

    Upload the file in the same Labs area, then visit an old URL in the browser and confirm it lands on the new one.

03Check it

Patterns for moves and migrations

Rules can be regular expressions with capture groups. The tutorial says to use the ECMAScript (JavaScript) flavor when testing, and suggests regex101 to check matches and groups.

The first moves /blog/post-slug/ to /post-slug/. The second turns WordPress category URLs into tag URLs, and the third strips year, month and day segments from WordPress dates. When you move off AMP, the same format works for sending old AMP paths to the normal post; see Ghost AMP.

Examples from Ghost's tutorial
301:
  ^\/blog\/([a-z0-9-]+)\/$: /$1
  ^\/category\/(.*): /tag/$1
  ^\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/(.*): /$1
04Worth knowing

What not to put in redirects.yaml

Trailing slashes

Ghost forces them automatically, so there is no duplicate-content case to redirect.

www and HTTP to HTTPS

Ghost's docs say to handle these at your DNS provider.

A new URL structure, such as `/tag/` to `/topic/`

Use dynamic routing in routes.yaml; you may still need redirects.yaml to send existing content to the new paths.

Bulk moves to the homepage

Redirect each old URL to the closest equivalent page instead.

Ghost's docs state no limit on rule count. For what a 301 does for search, read the 301 redirect glossary entry.

05Check it

Check it worked

Look for 301 (or 302) on the status line and the new path in the location header. If you get a 404 instead, check for tabs in the file, a pattern that does not match the exact old path, and a rule listed under the wrong key.

Confirm status and destination
curl -sI https://example.com/old-postname/ | head -5
Questions

Asked a lot.

2 questions people ask next, answered from the sources on this page.

01Does Ghost support 308 or 307 redirects?

Ghost's redirects help article says Ghost supports 301 and 302 redirects and lists no other status codes.

02Can I use redirects.json in Ghost?

Existing JSON files still work, but Ghost's docs say JSON support will be removed in a later version, so use YAML.

Sources · 4

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • ghost.org
  • google.com
  1. 01Redirects | Ghost Helpghost.org · checked 2026-11-01
  2. 02Implementing redirects | Ghostghost.org · checked 2026-11-01
  3. 03Routing | Ghost Developer Docsdocs.ghost.org · checked 2026-11-01
  4. 04Redirects and Google Search | Google Search Centraldevelopers.google.com · checked 2026-11-01
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane