I'm trying to figure out the best URL structure for my website that keeps a reference number (like 12345) at the beginning to avoid issues with truncated URLs. I also want to include page numbers (like /2 or /3) at the end. I'm debating whether I should use a dash or a slash between the reference number and the slug. What does the industry suggest for 2025 as the best practice for user experience and SEO?
5 Answers
Using /news/{id}/{slug}?page=1 is also a solid choice. Remember to set a canonical URL. You might also consider making slugs unique so you can skip the ID, but that has its challenges.
Honestly, it mostly depends on what the reference number represents. If it's for an article ID, I personally like /news/:year/:month/:day/:slug. If needed, you can have a canonical URL like /news/:hash for older versions.
I think the first option is better. It suggests that there might be more articles under the reference number, which is good for clarity.
Exactly, that's the idea I had too!
Totally agree with you!
The second option lets you change the article's name while keeping its URL if your API supports it. That's a big plus!
Yeah, I think you can parse both types easily, but keeping the reference intact is definitely key!
I prefer the first structure as well. The slug is just for user-friendliness; it shouldn't be critical for routing. Both URLs should work either way. Setting a canonical URL will help with any duplicate content issues. Just a thought: what if you included the page number like this: /page/2? It makes it clearer that you're changing pages.
That's an interesting angle! I never thought about page clarity.

Having the ID is useful since you can ignore the slug and change it without worrying about broken links!