Jump to content


This topic is now archived and is closed to further replies.


Is this a good design? (Database url linkage)

Recommended Posts

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?



Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.