I’m using the zend framework for my project – I’ve tried to set up using clean links – however I’ve noticed that my links seem to be getting really really long and wonder if at this point there would be a way to incorporate a structure where I could user smaller links.
Heres an example my website has a directory controller, which has a person action which takes an id parameter – so then a link to see a person of a certin id looks like:
www.mywebsite.com/directory/person/id/1809
It seems ok but I’m working now to make links more readable and search engine friendly – I would like to have something like – assuming the user ID 1809 is named John Smith:
www.mywebsite.com/directory/person/John-Smith-1809
Something really basic like the following would be even better:
www.mywebsite.com/John-Smith-1809
Although I don’t know how I could manage that without mentioning a controller or action…any ideas guys would really help…
Have a look at the ZF Manual on how to use Routes.
Basically, you need something like this to make it work:
Note: don’t expect this to run out of the box. You will likely have to modify it. Should get you into the right direction though.