Best way to create SEO friendly URI string

前端 未结 3 1207
-上瘾入骨i
-上瘾入骨i 2021-02-14 18:55

The method should allows only "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" chars in URI strings.

What is the best way to make

3条回答
  •  眼角桃花
    2021-02-14 19:17

    These are commonly called "slugs" if you want to search for more information.

    You may want to check out other answers such as How can I create a SEO friendly dash-delimited url from a string? and How to make Django slugify work properly with Unicode strings?

    They cover C# and Python more than javascript but have some language-agnostic discussion about slug conventions and issues you may face when making them (such as uniqueness, unicode normalization problems, etc).

提交回复
热议问题