I'm trying to optimize my URL structure and I need to include a reference number at the beginning, like 12345. I want to keep it upfront to avoid issues with truncated URLs. The page number, such as /2 or /3, will be at the end. I'm torn between using a dash or a slash as a separator between the reference number and the slug content. What's the recommended approach for 2025 in terms of user-friendliness and SEO best practices?
5 Answers
Go with the first option. The slug is mainly for user readability, so it shouldn’t dictate how routing works. In fact, you can have both formats function with or without the slug, just like this: /news/12345-slug-here-blah-blah/2 or /news/12345/2. Just make sure to set a canonical URL in the header to avoid duplicate SEO issues. Also, I personally prefer using something like /news/12345-slug-here-blah-blah/page/2. It’s clearer when changing pages instead of just slapping a random 2 at the end.
I like the second one. It allows you to change the article title while keeping the same URL as long as your API works with the /id/ part. That flexibility could be important.
But honestly, it shouldn’t matter. You can decode the reference number no matter if you use / or -.
Truth is, the practical implications are really up to your specific app. If there's no major difference for you, just pick one and stick with it!
If it’s not that important, I say the reference should be at the end for better human readability.
I prefer the first option. The second one suggests there are more articles under "12345", which might confuse users.
Exactly, that was my thought too!
Agreed on that!
Using /news/{id}/{slug}?page=1 is a great option. Remember to provide a canonical URL too. Another approach could be to remove the ID from the URL, but that can come with its own challenges.
Having the ID is helpful since it can stay the same no matter how many times the slug changes, which is important for external links.

That’s a solid point. The /page/ format definitely seems more user-friendly!