What are the benefits of using the ID (number) West with the slug in the URL?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
18 views
I often see on sites that in the URL, add record number (Primary key) in database to lagu in the URL.
Example:
/questions/411407/is-it-ok-to-include-an-id-inside-the-url
where ID - '411407' and SLUG: 'is-it-ok-to-include-an-id-inside-the-url'

For what reasons do it? And there is a sense from the performance point of view, if we have in the DB as ID and SLUG - have a UNIQUE index.
Often see is the formation of a URL, and I can not understand why do so.
by | 18 views

2 Answers

0 like 0 dislike
This is useful if the entry url may change, so old links are not broken. The sample comes from the database by ID, slug is compared, if relevant, an entry, if not, redirect to the actual slug
by
0 like 0 dislike
Doing it for SEO and not for performance.
\rhttps://google.com/search?q=url+slug+recommendations
by

Related questions

0 like 0 dislike
7 answers
asked Mar 22, 2019 by d43
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 11, 2019 by iAlex195
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
36,634 users