Ghost Redirects Error on Upload
I banged my head against the virtual wall for a week trying to figure this one out. Turns out it's a very simple fix.
.yaml
instead of .json
before you upload the Redirects or Routes file back to Ghost.If you use Ghost and want to redirect visitors to your website to a different post, page, or file you have to use the Redirects
option in the Settings menu. There's a support page for Redirects that walks through all the options.
But one thing confused me is when I downloaded the current Routes file is that it saved the file to my Mac as redirects.json
.
I opened the redirects file in VS Code, made my changes, saved it, and then tried to upload my changes back to Ghost and got this error message at the top of the screen:
, cannot fetch redirects
isn't that helpful as an error message. I assumed it had something to do with caching at the DNS or domain level and so I waited. Except when I tried again a few days later, it was still giving me that error.
I eventually gave up and contacted their support and while they were helpful, their tone kind of implied I was doing something wrong in renaming it to .JSON:
When reviewing the file, I see you have this composed in YAML, though the file is saved as a.json
file, instead ofredirects.yaml
.
Would you be able to try the attachedredirects.yaml
file, to confirm whether you have success?
When I renamed the file to redirects.yaml
it uploaded fine and my RSS feed was now redirecting properly from what I used to have it at to the new Ghost format. 🎉
All Good in the End
This may be obvious to some developers, but it wasn't to me. So I'm archiving it here and when I google the error message again in 6 months and find my own post with the answer, I can high five myself.
OR Ghost could just download the file with a .yaml
extension and save users and potentially support emails? I think it's a holdover from when Ghost used to use .json
files for settings and configuration so might just be a corner of the code that needs to be updated.
But that's not for me to know or understand. That's why I pay for blog + website hosting instead of having to update plugins and code myself. 😆