url shortening and clean urls |
[eluser]rickyracoon[/eluser]
I am working on a site that has a table in the database that stores links to some external articles, with the columns link_id, url, and title. My urls currently look like: http://www.site.com/article/324 I'd like to change it so the urls will look like: http://www.site.com/article-title-dash-separated ..and also provide a short-url version of the link that does not include the link_id but rather is just a random hash: http://www.site.com/F5ytK (example) How would I route requests to appropriate controllers since everything is just at the top level? I still need other areas of the site to route properly, such as: http://www.site.com/about Should route to the about controller. But what if an article has the title "about"? Or what if an article title ends up being the same as the short-url hash? How would I prevent collisions? What are the best practices here? I'd appreciate any suggestions. |
Messages In This Thread |
url shortening and clean urls - by El Forum - 08-06-2010, 02:19 PM
url shortening and clean urls - by El Forum - 08-06-2010, 03:38 PM
url shortening and clean urls - by El Forum - 08-06-2010, 05:07 PM
url shortening and clean urls - by El Forum - 08-07-2010, 11:41 AM
url shortening and clean urls - by El Forum - 08-07-2010, 04:42 PM
|