Tuesday, August 3, 2010

Re: URL shortener - any way to not redirect but display specific page?

On Mon, Aug 2, 2010 at 1:35 PM, spheroid <kevinsawicke@gmail.com> wrote:
> I am using a URL shortener controller which can take a URL such as:
>
> http://mysite/this-is-a-sample-page-23.html
>
> and redirect to another page like:
>
> http://mysite/controller/action/23
>
> Any way to have it effectively go to that page, but keep the initial
> url with the ".html" in it?

Just specify the directory path and view you want to render.

$this->viewPath = 'views/whatever';
$this->render('name_of_view');

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: