1

I am making a url structure similar to that of Stack Exchange webmasters.stackexchange.com/questions/{id}/{slug}, where no matter the slug you type there will be a 301 redirect to the correct slug as long as you got the right id. But I have found out that /{id}-{slug} could work the exact same way (the way I am programming at least), as in both cases the id is stripped from the url to present the right content.

So, is there any benefits doing this either way: /{id}/{slug} vs /{id}-{slug}? In the perspective of SEO, user experience, programming, etc.

2
  • 1
    User experience? The shorter URL is better.
    – Steve
    Oct 28, 2021 at 6:53
  • 1
    @Steve they will have the same amount of characters. The difference being a - and /.
    – Niklas
    Oct 28, 2021 at 7:51

0

Browse other questions tagged or ask your own question.