Support Forums

Rewrite rule with umaluts works with netlify dev but not in production

The following rule in my _redirects file:

/de/über-uns /de/about-us 200!

works locally when using netlify dev but not when deployed to production.

Other rewrite rules work perfectly.

Hi @AustinShelby

A 200 is a rewrite, not a redirect, it will return the content but not change the URL in the browser address bar. If you wish to change the URL, you need to use either a 301 or 302. Refer to the HTTP status code documentation.

Sorry I wrote it badly, I meant rewrite.

Changing the rewrite rule to

/de/%C3%BCber-uns /de/about-us 200!

Makes it work in production, but not with netlify dev.

In either case, when I visit /de/über-uns and /de/about-us I see the same thing. This is what you are wanting to achieve? Or is the issue that you can’t do it when using Netlify CLI?

Yes /de/über-uns and /de/about-us should show the exact same thing (which it now does as I have managed to find a workaround shown below).

The problem is that this rule:

/de/über-uns /de/about-us 200!

Only works with netlify dev and not in production.

And this rule:

/de/%C3%BCber-uns /de/about-us 200!

only works in production but not with netlify dev.

This is not something I have noticed before (probably because I generally use English) but I have replicated it. I notice there is nothing in the documentation about this as a limitation though.

Based on posts in Diacritics in redirects encoding characters such as ü is the accepted way of doing it. The fact this works differently using Netlify CLI is possibly a bug. You may wish to file an issue on the CLI repository.