Welcome Guest, Not a member yet? Register   Sign In
Dynamic routing names
#3

That is a really clever way to use the routes file, I have not tried that before. In fact have hardly ever touched the routes file.

When I had to do a shop and wanted friendly SEO urls I added a column in the db for url name and my contoller would url encode the product short name automatically to populate the column. The controller would take the url 'friendly' segment and try to decode it into a product id, by comparing to the column in the table.

The problem I found then was that product names were not all unique, leading to wrong products displayed on links where they were repeated 'url names'. I did not want to force the product name to be unique so I ended up adding stuff to make it unique on purpose, like teak-chair-247.

Then I discovered that some product names were becoming just messy horrible things, so I started letting the user input an SEO friendly name, and forced that to be unique, auto filling it with a suggestion from the product name +stuff if needed, to make the suggestion unique.

It was a real pain to be honest.

However, that was some time ago. Recently I read an article (that I think was found following a link from the forum here) about not using ID's in certain cases, so am about to try to implement something similar in an existing app. I have not decided how I am going to do it yet but AidanW's answer above has given me some new ideas to test.

So although not for seo reasons, changing url's for seo or for hiding id's is a similar thing. Would be interested if anyone has any better ways to do it.

Best wishes,

Paul


PS The blog post was here: https://philsturgeon.uk/http/2015/09/03/...struction/
Reply


Messages In This Thread
Dynamic routing names - by ignitedcms - 10-21-2015, 03:14 PM
RE: Dynamic routing names - by AidanW - 10-21-2015, 03:28 PM
RE: Dynamic routing names - by PaulD - 10-21-2015, 05:56 PM
RE: Dynamic routing names - by ignitedcms - 10-21-2015, 11:12 PM
RE: Dynamic routing names - by AidanW - 10-22-2015, 12:06 AM
RE: Dynamic routing names - by John_Betong - 10-22-2015, 02:13 AM
RE: Dynamic routing names - by ignitedcms - 10-23-2015, 10:57 AM
RE: Dynamic routing names - by puneetkumar - 07-13-2018, 12:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB