Redirect failure in next js application

I recently migrated an application already published on netlify to next js. When performing the migration, the redirects stopped working even though there was no change in the configuration.

My _redirect file remains in the build folder and as follows => 301!

It just stopped working, any suggestions of what might be going on, or any extra configuration I need to do because I’m now using next js ?

I want to redirect the subdomain ‘’ to ‘Sign in - Google Accounts

Hi @moraesdev

Do you have other rules in the _redirects file? Can you post the contents here. Also your real URL would help rather than a dummy URL.

@coelmay , Thanks for the answer !

follows image from _redirect file, I added a second rule as a test, but it didn’t work

default subdomain =>>

I want to redirect the subdomain ‘’ to ‘Sign in - Google Accounts

I have configured a next.js site at I have created a redirect for => such that all paths lead to the same endpoint i.e.*    301!

I am wondering if the first redirect rule in the file you provided is stopping the latter (the second rule will cover the first rule also so the first is technically not required.)


I removed one of the rules for a new test and the redirect still doesn’t work

Is the rule processed as part of the deploy?

This amount appears


What other rules do you have?

I was also surprised by this amount, because I intentionally didn’t declare any other rules besides this one. What can be generating this amount?

The Next.js plugin that Netlify uses.

I just checked that it doesn’t seem like that redirect rule is forced. Are you sure you’ve added the ! like you show in the screenshot? You can try downloading the deploy to see if that’s what’s getting deployed. In your latest deploy, I am seeing that the redirect rules exist in the netlify.toml and not in the _redirects file - that might be done by the plugin, but the redirect rule is not being forced and that’s not expected. It does convert it correctly in most cases.

Hi, thanks for the reply…

O! is added as shown in the image. I removed the toml file so we don’t have any doubts that the current settings are actually dressed in the _redirects file.

I downloaded the deploy and didn’t find the _redirects file, only the toml. I’m doing a new deployment for testing without the toml file.

After the last deploy with the deletion of my toml file, I verified that the _redirect file is not generated in the build. I downloaded the deploy to analyze and found only a toml file with several redirects from the next one, routes, but what I want to do is not present in the file, any idea how to solve it?

Where are you putting the _redirects file?

Place it in the public directory so it gets copied to the output directory during the build process (this is where I put mine.)


It is inside the public folder.

@coelmay any ideas on how to solve?

You have the _redirects file in the correct location. But you say you downloaded the last deploy and it wasn’t there. This doesn’t quite add up especially as the favicon.ico and rosa_seo.png files are navigable meaning they were copied.

Sorry, I don’t get the point, what am I supposed to do?

I wasn’t suggesting you do anything, it was more an observation that two files that are in public are making it to the deploy while the third (_redirects) isn’t, which does not make sense.

Have you tried building the site locally? Does everything end up in the build directory (including _redirects)? If so, there is no reason (that I can think of) this wouldn’t happen when building on Netlify also.

Hi @moraesdev,

I just checked your latest deploy and it doesn’t seem to have those webmail related redirects anymore.

@coelmay I understood, honestly this is being a mystery. In fact the file is not going up