Diacritics in redirects

I’m trying to create some redirects for old pages in my middleman generated site. These specific pages have diacritics in them like á.

Things I’ve tried:

  • both the _redirects and netlify.toml options.
  • The redirect rules that do not have diacritics are working correctly
  • I’ve also put both url encoded and non encoded values in the redirect definitions as well when trying to access the url’s in the browser.

When using the netlify dev command the redirects worked when in the netlify.toml file.

I always get the 404 page from netlify when deploying.

Any thoughts.

Hmm, did you try encoding the redirect in your redirect file? Something like this table should show the translation which for á I think is á:


In general we may already redirect your visitors to the html-escaped version of the page so best to quote it that way in your redirects file.

I can’t be sure this will work but I’ve seen it work for others. Let me know how it goes!

Thanks for your response, we’ve tried url encoding but not html entities.

We will give that a go and report back.

Hi @fool,

I’m working on this project with @kfpratt. Thanks for the suggestion but that didn’t work either. We know that our redirects file is working because other paths that don’t contain such characters redirect without issue.

What info can I provide that would help debug this on your side?

If you could send an exact redirect you’re using, then we’ll test and determine if it’s a bug (quite possible; we have some around unicode characters in URL’s and the like) and/or see if we can find a workaround. That won’t happen until next week since our office is closed over the weekend though!

Morning @fool,

Here are the three variations that we tried:

  • website-launched-on-canadian-bahá'í-efforts-in-international-development
  • website-launched-on-canadian-bahá'í-efforts-in-international-development
  • website-launched-on-canadian-bah%c3%a1%e2%80%99%c3%ad-efforts-in-international-development

Here is an example of what we’ve had in the redirects file (substitute the from for each variation above):

  from = "/website-launched-on-canadian-bah%c3%a1%e2%80%99%c3%ad-efforts-in-international-development"
  to = "[DOMAIN]/en_articles/1001"
  status = 301
  force = false

During testing, we’d replace [DOMAIN] with localhost and the redirect works fine using netlify dev, however when we replace [DOMAIN] with the actual domain and push to Netlify it redirects to the Netlify 404 page.

Thanks for your help with this.