Can I create INTERNATIONAL permalinks?

I was wondering how you feel about permalinks on international sites. By permalink, I mean some link that is unique and readable.

eg. for English phrases its not a problem, for example. / product / some-header /

but what will you do if the product name is, for example, in Chinese? How do you deal with this problem?

I am implementing an international website, and one requirement is to have humanoid URLs. Thanks for every comment.

+3
source share
6 answers

- /productid/ {product-id-number}/some-title/ {} "some-title". , , .

+1

ISO Latin-1 URL- , .

, URL-, <DOMAIN>/<LANGUAGE>/DIR/<PRODUCT_TRANSLATED>, :

http://www.example.com/en/products/cat/
http://www.example.com/fr/products/chat/

mod_rewrite :

RewriteRule ^([a-z]+)/product/([a-z]+)? product_lookup.php?lang=$1&product=$2

product_lookup.php?lang=en&product=cat. script ( lang, en), , , , "" , "" ..

API , , -. Google API , .

  • <= >
  • <= >
  • <= >
+2

non-ascii. , "täst" "taest". GNU iconv ( , ):

$ echo täst | iconv -t 'ascii//translit'
taest

, : , , "ä" "a", . , ( ) ASCII.

+2

Wikipedia. URL-.

, URL : http://ru.wikipedia.org/wiki/_. , ASCII, URL- . - URL- .

, - URL-, . .

+2

, URL-. , , , .

, , / , . :

foo.com/cat "cat" "gato" "neko" ..

HTTP-, URL-, , .

0
source

Creating a search for such a thing seems to be an overflow for me. I cannot create a search for all different words in all languages. Perhaps accessing the translation API would be a good idea.

So, as far as I see, its impossible to use external characters in permalink, since sepecs urls do not allow this.

What do you think about encoding special characters? Are these URLs recognized by Google?

0
source

Source: https://habr.com/ru/post/1697457/


All Articles