1

The standard behavior (*) for friendly URLs in Drupal is replacing special characters by a hyphen in the friendly URL.

For instance, without any input from the user, versão becomes vers-o and conteúdo becomes conte-do. However, we need the character to be replaced by their corresponding non-accent ASCII values, such as versao and conteudo.

Currently, we manually edit the URL when creating content. Is there a way to automate it?


(*): I assume it's out-of-the-box behavior, but this Drupal instance had modules installed and configured by other persons, maybe it's not a default behavior.

4

Have a look at the Transliteration module. Here is a quote from its project page:

... it takes Unicode text and tries to represent it in US-ASCII characters (universally displayable, unaccented characters) by attempting to transliterate the pronunciation expressed by the text in some other writing system to Roman letters.

As a sample, it transforms an URL like mydomain.com/последние-новости-в-Украине-и-мире in something like mydoamin/poslednie-novosti-v-Ukraine-i-mire.

However, to actually make this work, you also need to enable the Pathauto module. After that, go to the Pathauto setting page and check "Transliterate prior to creating alias". For more details on that, refer to "D7 Pathauto transliteration". Attention: this does not "fix" already created aliases (those need to be deleted and recreated).

4
  • I installed and tested it. It works only for file names. Nov 19 '15 at 15:54
  • 1
    I added the extra paragraph about the Pathauto module. Curious if that is how you can get it to work (also) ... Nov 19 '15 at 16:16
  • Seems like you got it to work, great! Thanks for accept also! Nov 19 '15 at 16:50
  • Yes, thanks A LOT for the tip! I really like it transliterates file names as well, it might prevent a lot of potential long-term issues with charsets and migrations =) Nov 19 '15 at 16:53
1

Are you referring to how Path Auto will create node paths? Regardless, there's good reason not to have extended characters in your URL:

The URI syntax has been designed with global transcription as one of its main considerations. A URI is a sequence of characters from a very limited set: the letters of the basic Latin alphabet, digits, and a few special characters. A URI may be represented in a variety of ways; e.g., ink on paper, pixels on a screen, or a sequence of character encoding octets. The interpretation of a URI depends only on the characters used and not on how those characters are represented in a network protocol.

You can alter how Path Auto generates it's paths found at /admin/config/search/path/patterns

1
  • I don't want extended chars in URLs. I want, for instance, conteúdo changed to conteudo instead of conte-do. Nov 19 '15 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.