My redirect in netlify.toml not working?

I just added a redirection to my netlify site khepri.netlify.app to my main domain (infinitythecalculator.com).

This is my whole netlify.toml file:

[build]
  publish = "dist"
  command = "vite build"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

[[redirects]]
  from = "https://khepri.netlify.app"
  to = "https://infinitythecalculator.com"
  status = 301
  force = true

[[headers]]
  for = "/manifest.webmanifest"
  [headers.values]
    Content-Type = "application/manifest+json"

[[headers]]
  for = "/assets/*"
  [headers.values]
    cache-control = '''
    max-age=31536000,
    immutable
    '''

I know my site has service workers and that sometimes doesn’t play nice with redirections, but I’ve nuked the data and tried navigating back various times, and I’m not seeing any 301 redirections in the chrome developer tools.

Thanks for the help.

You need to change the order of the redirects. Redirects are processed from top to bottom.

2 Likes

hi there, before we dig in, did you see this guide on debugging redirects?

I strongly suggest you give it a thorough read through and see if this fixes your problem:

if not, please post again, and we’ll try and troubleshoot.

1 Like

That was it, thank you so much!