Too many redirects after squashing commits


Too many redirects.

All I did was squash all the commits in a branch and force push. Deploying the older build works fine but this new build keeps throwing too many redirects error. Not sure what is wrong.

Hey @sheetmind

I see not correlation between a squash and commit and an infinite redirect.

A possible issue is you have configured via the Netlify UI but a redirect rule *(in either a _redirects and/or netlify.toml) is redirecting this to This would cause the infinite redirect loop you are seeing.

Is there are _redirects and/or netlify.toml file in the repository with rules defined?


I was looking at build logs and realized that the next.js middleware was served via Netlify edge functions. This was causing too many redirects. Modifying the middleware fixed it for me.

1 Like

Thank you so much for coming back and letting us know.