pretty urls : wordpreess like |
[eluser]dianikol85[/eluser]
Hi to all!! Here is the thing. Lets i have a product with ID : 1 name : product_name in order to view this products details i pass to the controller via an anchor link the id anchor('product/ID', Product); You get the idea. it's a standard. what i need is that i want a clean url in the browser with product name instead of the id for example from www.example/product/1 to www.example/product/product-name CI have some helpers to do create such strings but i am not sure how to pass it to the url for every product, The problem is i guess without the ID it may be confuse because i may have the same product name twice for example. Any ideas?? Thanks in advance
[eluser]Atharva[/eluser]
You can use Code: url_title()
[eluser]eoinmcg[/eluser]
an alternative method for dealing with duplicate url names http://ellislab.com/forums/viewthread/125827/
[eluser]dianikol85[/eluser]
Thanks. I just did an expirament in wordpress by adding two new posts with tha same article. Let's say "test" In the second post it produced example.com/test-2 So the wp adds a unique seo-title in db i guess as Atharva said. I think i'll do the same by adding the inserted row id like this: example.com/12-title where 12 is the id. Do you suggest something better than this? |
Welcome Guest, Not a member yet? Register Sign In |