Too many redirects after squashing commits

Site:
sheet-mind-web-prod.netlify.app

Error:
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 sheetmind.com via the Netlify UI but a redirect rule *(in either a _redirects and/or netlify.toml) is redirecting this to www.sheetmind.com. 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?

Hi,

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.