Re: show id in url on function call

2011-12-18 Thread Geoff Douglas
I agree. meinstream, make sure you set the second param to 301, if you want google and the like to take note of the new urls. Controller Code: $this->redirect(mixed $url, integer $status, boolean $exit) * * -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Ch

Re: show id in url on function call

2011-12-18 Thread euromark
@geoff: but if he doesnt do a 301 redirect he's gonna shoot himself in the foot On 18 Dez., 08:06, Geoff Douglas wrote: > The only way to change the URL in php, is by doing a redirect. In straight > PHP you would set the header location. In Cake you can just do a redirect. -- Our newest site f

Re: show id in url on function call

2011-12-17 Thread Geoff Douglas
The only way to change the URL in php, is by doing a redirect. In straight PHP you would set the header location. In Cake you can just do a redirect. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.

Re: show id in url on function call

2011-12-17 Thread euromark
for search engines you can use canonical tag but besides that your method looks pretty wrong to me what if an invalid url is passed? it should be more like if (!id || !(record = findFirstById)) { record = randomOne } On 16 Dez., 22:43, meinstream wrote: > Hi, > > looking for a way to show

show id in url on function call

2011-12-16 Thread meinstream
Hi, looking for a way to show the Id in the url when calling a function that was not getting an id via get. Not giving an Id to the view function will trigger a random id that works fine like this: function view($id = null) { if ($id == null) { $random = $this->Movie->find('f