Right now I can get the information for a product in my database by simply using its ID in the URL lik so: http://www.example.com/?productID=5
Now I can guess the next one since these IDs are all auto incremented.
How would you hide this ID and replace it with something better? I mean it still has to be a unique identifier.
To complicate it a little I was thinking I could use a global unique identifier and add this in the database in another column. But I have the feeling that this is not the best way to do this 🙂
Please let me know your thoughts and tell me how you solved/would solve this in your project.
What I basically want is to get rid of knowing the next/previous ID.
There are no security limitations on the products themselves. Users are most likely allowed to see them. I was thinking that this technique could prevent crawling all products?!?
Like what amazon.com does: It looks like they hide the item’s ID in some way, right?
You could also use a slug which works great for SEO. so Product 1 slug could be http://www.example.com/?productSlug=exampleitemnameasoneword
You just have to make sure slugs are unique. You would of course need a slug field in your database entry and be able to enter/edit it.