Redirects within netlify.toml not working?

Hey all, I have been having trouble getting redirects to work when defined in the netlify.toml file, but they seem to work when defined in a _redirects file instead. Here’s a link to the toml file I tried in the past:

I instead had to replace it with:

I was following Kent C. Dodds’ tutorial for the URL shortener and forked his project which contains a netlify.toml that seems to work for him and I assume others since I haven’t seen any mention of problems. Here is his toml file that I forked:

It works for him in his tutorial but not when I do it.

Is there a setting somewhere to properly enable redirects when creating a project? Here is the site that I’m following the tutorial with: https://ct-short-link.netlify.com/

Hi,

ct-short-link doesn’t appear to be a valid netlify site, did you rename or delete it? If so, please provide a link to one of your deploy logs with the netlify.toml in it so we can take a look. Thanks.

@futuregerald
Yes, I had deleted it but I have remade it again with the same fork of the project. Here is the link to the Github repo: https://github.com/chris-tse/airtable-netlify-short-urls

The site name I have remade it to be ct-short-link again.

According to the last redirect rule, /magic should be redirected to the function route, but it doesn’t seem to work. It does function correctly when I navigate directly to the function endpoint like /.netlify/functions/redirect/magic (which is supposed to redirect to YouTube).

Hi @chris-tse,

The repo you forked that’s linked to that site doesn’t have your redirect rules that you mentioned in it. Can you give me a URL that’s not redirecting like you are expecting it to? Thanks.