Mobile app version of vmapp.org
Login or Join
Connie744

: Should I use semantic URLs when they might change from time to time? My application relies heavily on the hierarchy of its entities and the hierarchy also gives needed context to the entities

@Connie744

Posted in: #CleanUrls #Url

My application relies heavily on the hierarchy of its entities and the hierarchy also gives needed context to the entities details page. Hence my current URL scheme represents the hierarchy: /grandparent/parent/child

Since I'm working towards having everything be user created content, the nesting is bound to change from time to time. But I really hate dead links, so I think my options are:


append -[ID] to every URL and redirect the path if an already changed path is opened
same as above but without the path (URL would only change, when the name of the entity is changed
track all the path changes and redirect to new path if an old path is opened. This might get weird, when a new entity has a path that once existed. I would need to display a message saying, that the user possibly meant to visit a different resource that once was at that location


I like the third option insofar as the URLs stay clean and ID free, but I think the first option is the most solid one. Am I missing something?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

Ideally all URL changes would be tracked and you would implement redirects from any old URL to a new URL. Doing so is important so that inbound links to your site don't break and so that search engines continue to index and rank your content when it moves.

I love semantic URLs, but I'm not a fan of deep hierarchies in URLs. URLs should:


Uniquely identify the resource
Describe the resource adequetly
Be easy to type for best usability
Be easy to remember for best usability


Because of the last two, I would tend to drop parents from the URL when possible. I prefer /widgets over /household/kitchen/widgets. If you also have other widgets I might even do /kitchen-widgets or possibly /kitchen/widgets if you have a /kitchen/ page.

Having a hierarchy URL certainly complicates renames. Especially when it is a parent or grandparent that is renamed. If you do have those in the URL, an ID in the URL would make it a lot easier.

IDs are also good for user generated content because you don't have to force users to come up with unique names. Forcing users to do so can decrease the number of people willing to create content.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme