问题原文
原帖链接 · Matthew Brown aka Lord Matt · CC BY-SA 3.0
The design decision was to automatically replace spaces with dash (-) when building URLs. This led to URLS such as example.com/user/john-smith. This was fine as long as names were "JohnSmith" and "Fred Bloggs".
Then comes "Freddy Double-Barrel" and we have a huge encoding headache. His URL is example.com/user/freddy-double-barrel which looks exactly like his name is "Freddy Double Barrel" (entirely the wrong string for looking this fellow up). So this user's profile is always 404 because there is no easy way to decode back again.
So how do I represent actual dashes when we are using dashes as spaces?
社区高分解答
原帖链接 · marcanuy · CC BY-SA 3.0
The URL does not need to contain such level of detail.
It is perfectly fine to have the url you propose: example.com/user/freddy-double-barrel for Freddy Double-Barrel.
From a SEO point of view, the url should cover two aspects:
- be appealing to users
- describe what the page is about
A url like example.com/user/freddy-double--barrel or example.com/user/freddy-double_barrel does not change anything, they even look a bit unnatural to me.
Most of the slugs generator strip special characters from the title to create a clean and readable url.
Consider the following example, this is the first result in Google for guillain-barre:
The webpage url is: http://www.mayoclinic.org/diseases-conditions/guillain-barre-syndrome/basics/definition/con-20025832 with guillain-barre-syndrome, but its title is: Guillain-Barre syndrome
As long as your page title, meta description and/or content properly says Freddy Double-Barrel, it is perfectly fine to keep the current slug scheme.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
