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:

1 Like


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.

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:

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.

1 Like

as @chris-tse mentioned, it seems that the redirects on the netlify.toml file does not work. with the _redirects file woks perfect.

here’s my github fork where I fix the issue:

hope this helps!

Those redirects should be working from the netlify.toml. But I’d need to see a site that has them deployed to dig in to it further. Let me know if anyone has a link. Otherwise I’m glad you found a workaround @horacio

Gerald, any update on this? You responded recently to a support ticket I made regarding the issue around inability to redirect with netlify.toml file. My thread hasn’t been resolved and I see others are experiencing the same issue. It would be good to know if it’s a temporary issue or if redirects in the toml file are deprecated.

hi @vict- There are no changes to redirects through netlify.toml that I am aware of, so it must be specific to your situation in some way. Sorry to hear you are still having trouble. If you are already working in the helpdesk, you will get a response there as soon as we are able to provide one.

@vict-r - is this still a concern? if not i will close this thread. thanks.

Thanks @perry. I never got subsequent response or closure on the issue so I’ve been forced to try _redirects. Even with _redirects I am experiencing issues with that but I posted that to another thread and hoping for response.

In any case, feel free to mark this as closed but unresolved.

1 Like

sorry to hear you are still having trouble, we will keep an eye on that other thread.:muscle: