In my website users sign up. Then in the users panel, they can add items (ex. services they provide such as "Business Card Design") that may be not unique; i.e. other users may add that item too. But properties of that item for two different users may be different. So, the page for that item must be loaded based on the user. Items belong to categories and we can have two items with same name in each category. Categories may have parent and children.

What is the best URL folder structure for this system?

Beside generating folder structure, my suggestion is to point items by ID; not only its own ID, but also its user and category's ID.:


But as most of seo websites such as MOZ suggest, it's better to limit folders in the URL structure. They just mention that finally it's up to my judgement.

I can omit the first level folder "user" and just use the username after homepage URL:


but it gets complicated when a user signs up with username "blog", "item", and perhaps some future specific page names that I'll need.

Is there a better way to do this?

Edit: Based on suggestions I came up with that user and category folders are not necessary, but item title is needed for seo pov. But I added their IDs at the end separated by dashes from item id. IDs are not supposed to change, but item url title may change:

  • Which site would be a better choice for this question? And is there a way of moving it there and leaving a pointer from here to there? – iheggie Sep 7 '17 at 15:32

Search engines shouldn't have access to use specific pages (The fact "fred smith" ordered "how to sue my wife" should not be public information (especially to Susan his wife lol)) therefore no SEO issues applies to those pages.

Any page that has public information should have a url which is stable - ie if some bookmarked it months ago it should still work now even if the name of the document has been expanded or corrected. This is typically done by either using a numeric id and ignoring the text after it (like rails does), or keeping a list of redirections automatically when you change the url (typically then once a object is published with a url you store the url created and allow the operator updating the items name the choice of keeping or changing the url (keep if you are adding filler words, change if correcting spelling etc)

I wouldn't add user and product id into the url at that stage, instead I would probably make the product link to the standard product page and dynamically insert the information that you have so many of this item in your cart and allow them to change that number or discard the item from the cart.

Ie generally only encode permanent state into the url (eg which product), don't mix in transitory state - use sessions and associated temp storage for that - by doing that your users can bookmark pages and get back a reasonable result when they return. If they have actually ordered, then a permament url that returns the details of the order is fine, but the product links from that typically would still be to the generic product page.

  • Great answer. Please see my edit. Any new suggestion? – mrmowji Feb 17 '17 at 19:11

I agree with iheggie's response, especially as it pertains to visibility of resources.

Adding to that, people frequently refer to "REST" in this conversation https://en.wikipedia.org/wiki/Representational_state_transfer . This can help define some characteristics of URL structure and the meaning thereof.

REST itself is a broader topic than needed here, though. Based on my experience a nested, deep hierarchical structure is usually not a good idea, since it isn't meaningful to a user, nor to a search engine.

If the category (id or title) can ever change, then the URLs become brittle, and don't accurately represent the resource.

Ultimately the resource being described is an "item". I would suggest using "site.com/item/". Where slug is partly described here: https://seo-hacker.com/url-seo-tutorial/

This has the effect of being meaningful and immediately identifiable to user, having some value to a search engine, and uniquely identifying your items, as long as the server has slug capabilities.

  • Thanks for your answer and suggested articles. Please see my edit. – mrmowji Feb 17 '17 at 19:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.