What’s the Best URL Structure: Slugs and IDs?

0
15
Asked By CuriousCat42 On

I'm trying to decide between two URL structures for my articles. The first option is /news/12345-slug-here-blah-blah/2 and the second is /news/12345/slug-here-blah-blah/2. I definitely need to keep the reference number (12345) at the beginning to avoid issues with truncated URLs, and the page number (like /2 or /3) should be at the end. My main concern is how to separate the reference number from the slug content—should I use a dash or a slash? I'm considering user experience when sharing links and want to ensure it's also optimized for SEO. What's the best practice for 2025?

5 Answers

Answered By StructGuru On

Honestly, I think this decision is about user preference. The first one has better SEO implications since it avoids unnecessary directories, but some argue for semantic clarity in the second option. Maybe simplifying it further by dropping 'news' could make the URLs cleaner too.

Answered By CodeNinja99 On

If the reference number is essential, I’d say go with the second format. It allows you to change the slug without affecting the URL. This way, you can keep links intact even if you update your article titles.

Answered By WebWizard89 On

I personally prefer the first format. The second option suggests that there could be more articles under '12345', which might not be the case. The first one feels cleaner and more straightforward for users sharing links.

Answered By SEO_Savvy On

The first option makes sense as the slug is mainly for human readability. Ideally, the URL should be functional even without the slug, so that both /news/12345-slug-here-blah-blah/2 and /news/12345/2 should work just fine. Just remember to set a canonical URL in your headers to avoid duplicate content issues. I also think using /news/12345-slug-here-blah-blah/page/2 makes it clearer that you’re on a different page.

Answered By DiscussionDude On

It really depends on what the reference number signifies. If it's just an id for the article, then using /news/{id}/{slug}?page=1 might be more organized. But if you need older versions, consider a canonical URL that could help in browsing past versions.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.