Can not upload redirects.json file to my Ghost (Pro) blog


#1

I want to implement some redirections for my new blog, but every time I want to upload modified redirects.json I got an error «Could not parse JSON: Unexpected string in JSON at position xxx».

It heppend even with example code from the official tutorial.

For editing I use Sublime Text

Here is my redirects.json — https://d.pr/f/1XreRI


#2

@b166ar the redirects.json file that you’ve uploaded to droplr appears to be empty or the upload has failed? Either way the download from droplr is not working so I’m unable to check the file


#3

Sorry, my fault. Here is my redirects.json:

[ {
"from": "/best-mac-soft-2018/",
"to": "/best-mac-soft/"
"permanent": true
}

{
"from": "/best-mac-soft-2015/",
"to": "/best-mac-soft/"
"permanent": true
}

{
"from": "/best-mac-soft-2014/",
"to": "/best-mac-soft/"
"permanent": true
}

{
"from": "/best-mac-soft-2013/",
"to": "/best-mac-soft/"
"permanent": true
}]

#4

You’re missing commas between closing curly brackets (}) and opening brackets ({).

You can check that your redirects file is valid by using a JSON linter like https://jsonlint.com/


#5

Thank you @vikaspotluri123, this validator helped me.

@Kevin, there is a mistake in «Redirect an old URL to a new one» section of official guide.


#6

@b166ar thanks, I’ve updated the doc!


#7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.