# 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.

Canonical: https://scaplet.com/seo/ghost/redirects

Guide Ghost 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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fghost%2Fredirects%20(%22Ghost%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fghost%2Fredirects%20(%22Ghost%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fghost%2Fredirects%20(%22Ghost%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fghost%2Fredirects%20(%22Ghost%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 3 minutes.

1. [The file and the format 01](#the-file-and-the-format)
2. [Upload steps 02](#upload-steps)
3. [Patterns for moves and migrations 03](#patterns-for-moves-and-migrations)
4. [What not to put in redirects.yaml 04](#what-not-to-put-in-redirects-yaml)
5. [Check it worked 05](#check-it-worked)

_01_What 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](/glossary/how-to-guide) 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.

_02_How 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](/glossary/301-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.

**An empty file wipes your redirects**Ghost's tutorial says uploading an empty file removes "all existing redirects on your site." Keep a dated copy of the file before every upload.

_03_Check 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](/seo/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
```

_04_Worth 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](/glossary/301-redirect).

_05_Check 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.

_01_ Does Ghost support 308 or 307 redirects?

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

_02_ Can 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. 01 [Redirects | Ghost Help](https://ghost.org/help/redirects/) ghost.org · checked 2026-11-01
2. 02 [Implementing redirects | Ghost](https://ghost.org/tutorials/implementing-redirects/) ghost.org · checked 2026-11-01
3. 03 [Routing | Ghost Developer Docs](https://docs.ghost.org/themes/routing) docs.ghost.org · checked 2026-11-01
4. 04 [Redirects and Google Search | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/301-redirects) developers.google.com · checked 2026-11-01

## Keep learning

[All platform guides](/seo)

[Learn Ghost AMP CMS](/seo/ghost/amp) [Related 301 redirect Crawling and indexing](/glossary/301-redirect) [Read next Ghost SEO CMS](/seo/ghost) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Submit a sitemap to Google Search Console](/seo/google-search-console/sitemap-submission)

More in Ghost SEO
[Ghost AMP](/seo/ghost/amp) [Ghost canonical tags](/seo/ghost/canonical-tags) [Ghost redirects](/seo/ghost/redirects) [Ghost title and meta](/seo/ghost/title-and-meta)

Terms on this page
[How-to guide](/glossary/how-to-guide) [301 redirect](/glossary/301-redirect)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
