Does redirects.json work with Ghost REST API?

I’m looking into setting up redirects using the redirects.json feature:

Tested around but could not get it working. Should I expect the API request URL to redirect? Or does this feature only work when using a Ghost template vs. the REST API?

Here’s my redirects.json:

        "from": "the-future-of-public-finance-is-coming",
        "to": "lets-restart-the-hidden-economic-engine",
        "permanent": true

Requesting this URL in a browser:

Still yields the following API request, which 404s:

Ideal scenario would be to redirect the browser to the new page:

Less ideal but workable scenario would be that the API request redirects the slug:


Ghost’s redirects.json does not affect the API at all, it only deals with URLs (not slugs) and will redirect a request coming in to the front-end not the API.

Eg. redirects.json:

       "from": "/old-post/",
       "to": "/new-post/",
       "permanent": true
] → (301) →

1 Like

The docs cover typical use-cases:

Ah, bummer. Thanks @Kevin. Given that redirects.json does not affect the API at all, I’ll solve this with NGINX.

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