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 á:

https://www.freeformatter.com/html-entities.html

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):

[[redirects]]
  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.

Super sorry to be slow to get back to you, Abdullah! I’d like to see your attempts - any chance you can tell me your netlify site ID so I can look through your old deploys to find those 3 attempts, since I can test the permalink to the old deploy to reproduce and either file a bug or get you less “well it seems like this should work but I can’t tell without the rest of the context” type advice?

If you don’t want to share the sitename publicly, you can literally tell me the API ID on your General Settings page and I can use that to look it up.

No worries. Is there an email or a way to DM you the info? Is it ok to post the API ID here?

Yes, it’s safe to share the app ID publically. People can’t do anything with it unless they also have your secure token. Thanks @abdullah

Thanks @futuregerald. The app id is e0555c92-702d-4a98-95e2-13c8381bb012

Hi again Abdullah,

As you are keenly aware, we haven’t been able to make time to do much research on this. When I took a look I couldn’t see any 404’s in the past 30 days for any URL containing the string:

website-launched-on-canadian-bah

So I a not sure we were seeing your traffic at all.

Any chance you can point me directly to a deploy that had each redirect in place? You can give me just the ID from the end of the page with that deploy’s logs if you don’t want to link.

It’s pretty hard (on our database) for me to pick through 768 deploys on that site, as it turns out, looking for the changes.