How to Find the Redirect Section on Your Ghost Account
Tags: ghost, webdev, beginners
Published: 2024-05-16 12:23:20

A bit ago I realized I needed to generate redirect text for each of my current blog posts. Before posting about that; however, I wanted to go over redirects briefly... that said, if you are looking for the full solution _now_ you can find the original post on my website at [Oh No, I Need to Create Redirect Text for All My Posts!](https://www.simplykyra.com/blog/oh-no-i-need-to-create-redirect-text-for-all-my-posts/). Both there and below will be talk about the redirect file through [the Ghost](https://ghost.org) interface.

A redirect is when you want to send someone to a different URL than the one they just typed in. For me I wanted to do this back when I first migrated from Wordpress to Ghost and again when I changed all of my posts' urls to better organize my site. This meant that all of my currently set links no longer worked as they now pointed to the old location with a `404 Page not found` error and I needed to redirect them to the new location.

To do this redirect, through [Ghost](https://ghost.org), you need to find the redirect file by going to your domain and then typing in `/ghost/#/settings/labs` immediately afterwards. In my current website, running [version 5.82.3+moya](https://github.com/TryGhost/Ghost/releases/tag/v5.82.3?ref=simplykyra.com) this looks like:


![The settings, running version 5.82.3+moya, shows the Labs section with the beta features including Redirects below it. Here, beside Redirects, is a bolded button to upload the file and below, in green, you can download the current version.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tgrvv1h8u10rcqmjksgh.png)

While my localhost instance, which is still running [version 5.39.0](https://github.com/TryGhost/Ghost/releases/tag/v5.39.0?ref=simplykyra.com), it instead is a two step process that starts with the labs, in the lower right corner:


![In the older version, 5.39.0, you need to go to advanced and press Labs before you see the same thing.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57hvccf5uo39ms07b7ai.png)

And then shows the sub-options here: 

![Though once you're in Labs it looks pretty similar to the new way.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4lg5hp4apgq0101pejd.png)

The redirect file itself is essentially just an array `[]` where each object is a single redirect consisting of the from, to, and whether it's permanent or not. So, in my case, if my old blog posts' urls were `domain/2017/10/16/halloween-costume-chuggington-onesie/` and `domain/2017/11/25/make-your-own-playdough/` the their new ones would now be `domain/halloween-costume-chuggington-onesie/` and `domain/make-your-own-playdough/` In this example the array would look something like this: 

```
[{"from":"/2017/10/16/halloween-costume-chuggington-onesie/","to":"/halloween-costume-chuggington-onesie/","permanent":true},
{another redirect objects},
...
{another redirect},
{"from":"/2017/11/25/make-your-own-playdough/","to":"/make-your-own-playdough/","permanent":true}]
```

Once you download and edit the file you can upload it back to your website through the same page. If there's an error it will tell you immediately and, worse case, you can use an online `json` editor to help find your issue. Once it's uploaded properly you can then type in the old link and you'll be redirected to the new one rather than get the old pesky `404 Page not found` error again. 

Word of warning: Just be sure this file was entered correctly. You don't want to redirect a working page url to a non-working one. I did that with my about page by mistake and ended up just editing its url for a quick solution rather than figuring how to *undo* the redirect. 

And with that I'll leave you with some links in case your want more information about [Ghost's documentation on redirects](https://ghost.org/help/redirects/?ref=simplykyra.com) or [their tutorial about Implementing redirects](https://ghost.org/tutorials/implementing-redirects/?ref=simplykyra.com). Hope you're having a great day!