b166ar
November 12, 2018, 5:22pm
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
Kevin
November 12, 2018, 5:38pm
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
b166ar
November 12, 2018, 6:07pm
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
}]
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/
b166ar
November 12, 2018, 7:54pm
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.
Kevin
November 12, 2018, 8:16pm
6
@b166ar thanks, I’ve updated the doc!
system
Closed
November 26, 2018, 8:16pm
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.