Support

Admin Tools

#37991 Url redirection accented characters issue

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
3.10
PHP version
7.4
Admin Tools version
6.1.7

Latest post by activha on Thursday, 03 November 2022 10:10 CDT

activha

Hello

It seems like we have issues with url like :

conditions/4-conditions-générales-d-adhésion-au-programme-d-affiliation 

When accented characters are included the redirection to the target fails.

Target is : 

conditions/conditions-générales-d-adhésion-au-programme-d-affiliation

Could you add a setting which allows to use accented characters ,

I also try to add : conditions/4-conditions-g%C3%A9n%C3%A9rales-d-adh%C3%A9sion-au-programme-d-affiliation 

But this also fails to redirect to the target

 

All others redirections without accented characters are working fine by the way

Thanks for your help

Jean

nicholas
Akeeba Staff
Manager

There is nothing we can or should do because this is between your browser and your server. The URL your server sees is something like this:

conditions/4-conditions-g%C3%A9n%C3%A9rales-d-adh%C3%A9sion-au-programme-d-affiliation

This is the URL you need to redirect. I tried that on two different test sites and it works.

IMPORTANT!

If you have a multilingual site which adds the language slug in the URL you need to also include it in the URL you are redirecting from. So, if your site adds /fr/ for all French pages you'd have to redirect fr/conditions/4-conditions-g%C3%A9n%C3%A9rales-d-adh%C3%A9sion-au-programme-d-affiliation instead. I don't see your site doing that but it's good to know.

Remember that browsers usually URL-encode any character which is invalid in a URL, including accented Latin-1 characters and several special characters. It is very strongly recommended that your URL aliases do not contain accented characters. Ideally, your aliases should consist entirely of the lowercase characters a-z, numbers 0-9, dashes and underscores. Anything else will be trouble.

As to why we shouldn't do anything about it. We could try to URL-decode the path. But… URL decode with which character set? UTF-8, ISO-8859-1, Windows-1253, something else? Choosing the wrong character set could result in an invalid path which could have unexpected results in redirections. To give you an idea, URL-encoding the character é in ISO-8859-1 codepage results in %E9. URL-encoding the same character as UTF-8 results in %C3%A9. URL-decoding the latter as ISO-8859-1 results in Ã©. So, if we decoded the URL conditions/4-conditions-g%C3%A9n%C3%A9rales-d-adh%C3%A9sion-au-programme-d-affiliation as ISO-8859-1 we'd get conditions/4-conditions-générales-d-adhésion-au-programme-d-affiliation and we'd still be unable to figure it out. Trying to URL decode the URL conditions/4-conditions-g%E9n%E9rales-d-adh%E9sion-au-programme-d-affiliation as UTF-8 would fail to decode %E9 leading (in the best case) to conditions/4-conditions-gnrales-d-adhsion-au-programme-d-affiliation (missing characters). It gets worse when you have to take into account code-pages other than Western European such as Greek, Cyrillic and so on. Since the encoded URL does not contain information about the character set we do not have a well-defined problem to solve. Browsers encode URLs based on what the server tells them it supports, information we do not have access to when we need to do URL decoding.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

activha

Thanks a lot for this detailed explanation as usual :-)

Works perfectly well like this.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!