问题原文
原帖链接 · Hassan Baig · CC BY-SA 4.0
I'm a server-side developer dabbling in SEO practices for the first time. This question is about getting the url structure right for a web application I'm developing, goal being having some which is search-engine friendly (especially Google).
Background:
The web application I'm developing contains user generated "topics" in which said users can submit bite-sized text/image posts associated to the topic. It's kind of a cross between Reddit and Twitter.
Question:
Imagine a topic for the popular movie Avengers: Foogame on my site. Following are the candidates I have for a URL pointing to this topic (where 1 is topic ID to ensure the URI is unique):
example.com/topic/1/avengers-foogame/example.com/avengers-foogame/topic/1/example.com/avengers-foogame-1/example.com/avengers-foogame/1/
Notice all variations include a topic ID, which is irrelevant from a search perspective. Will it adversely affect the search-engine friendliness of the URLs in question, or can it stay? Moreover, which of the above variations would be the most desirable from an SEO perspective? Or are they all suboptimal?
I would really appreciate getting guidance from industry experts regarding how to tackle this.
To me, it looks like the third option is the best candidate out of the lot. Why? Because I've consistently read that URI tokens (words) are weighted in order of writing, and 3 seems to take advantage of that the most.
I understand that URL structure is but a small drop in the vast ocean of SEO, but I do want to get it right in any case.
Note: this is not a dup of another question regarding url structures and IDs, since that deals with something else entirely.
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 4.0
Google doesn't use keywords in the URL path as a ranking signal much right now (maybe even not at all.) Putting keywords in the URL won't change the SEO directly. It will only change the SEO indirectly through better usability. See Are keywords in URLs good SEO or needlessly redundant? which suggests:
- Use a few descriptive keywords in the URL path for better usability
- Put the numeric id towards the beginning so that it doesn't get lopped of in cases when the URL gets truncated
As for the slashes vs dashes see Use forward slashes (/) or dashes (-) for URL design in 2019? (for categories in e-commerce) which suggests:
- Either can work fine for SEO
- Slashes imply directories, so they should only be used when you plan to support URLs that have been trimmed to the directory level. In your case, that would mean supporting URLs like:
/topic/1/topic/
You also might be interested in Does it make a difference if your URL path ends in a trailing slash or not? which says that the trailing slash on your URL isn't needed and just makes your URL more complicated.
Putting that together, I would suggest using the URL:
/1-avengers-foogame
You should also implement URL canonicalization so that all the following get redirected to the preferred URL:
/1-Avengers-Foogame(capitalization)/1-avengers(truncation)/1-avengers-foogame/(additions)/1-avenjers-foogame(misspellings)/1-xyzzy(junk)/1-avengers-foogame?foo=bar(query parameters)
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
