arbitrageur Posted November 19, 2014 Share Posted November 19, 2014 (edited) So, built a classifieds site. The link is something like this: mysite.com/category/subcategory/1234 The category & subcategory don't do anything, they are just for vanity. My question is about the '1234'. The number corresponds to an "id" which is a unique key in my database. When people make a post, I use LAST_INSERT_ID() to get the most recent post and generate the URL. So basically, my urls correspond 100% to database ID's, for better or worse. These go up by 1 with each post. I anticipate some potential numbering issues when I eventually delete posts. Would it be a better idea to generate these unique IDs some other way, or is this acceptable design? Thanks. Edited November 19, 2014 by arbitrageur Quote Link to comment https://forums.phpfreaks.com/topic/292571-is-this-a-good-design-database-url-linkage/ Share on other sites More sharing options...
dalecosp Posted November 19, 2014 Share Posted November 19, 2014 It's pretty standard design.Also, don't underestimate the words "category', "subcategory", etc. Use words people can remember and that search engines (or at least search engine users) can understand. What "potential numbering issues" do you anticipate? When we remove a product at OMBE, we just serve a 410 or 404, as appropriate. 1 Quote Link to comment https://forums.phpfreaks.com/topic/292571-is-this-a-good-design-database-url-linkage/#findComment-1497041 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.