Redirects.json not working properly(not all characters are taken into consideration)

Hi,

There is a bug in redirects functionality because it doesn’t take into consideration all the characters.

For example, I want to redirect the following URL:

/vacanta-in-praga-cehia-│itinerar-de-3-zile/
to
/vacanta-in-praga-cehia-itinerar-de-3-zile/

but it doesn’t take into consideration “│” character and the redirect doesn’t work. I still receive the 404 and no redirect is triggered.

BR,
Catalin

Ghost doesn’t expect to find special regex characters like | . Well, it does expect them, but it doesn’t treat them like plan characters. Try preceding special characters with \, so like this:

301:
  ^/vacanta-in-praga-cehia-\│itinerar-de-3-zile/: /vacanta-in-praga-cehia-itinerar-de-3-zile/

I also added a ^, which tells Ghost that’s the start of the path, which can be helpful for preventing redirect loops. :slight_smile:
Note the spacing - yaml files are fussy about it!

Hi,

I’m using json extension. I have tried your option but when trying to upload the redirects.json file into “Labs” I receive error: “, cannot fetch redirects”

BR,
Catalin

Right. I gave you the .yaml version. :)

Still not working, even with .yaml version. :slight_smile:

Hmm. Not at my computer to test, but it may be that you need all regex format, like in this example:
Implementing redirects in Ghost (Scroll down a ways.)

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