2009年2月5日星期四

Re: [fw-mvc] Redirect from a custom route - best option

Hi,

> In case of certain conditins i need to redirect 301 to other URL.
>
> I am wondering which option should be better for this:
> a) i am missing something so that's why redirect doesn't work; i
> would try with a header('Redirect...') but i would like to stay with
> ZF rather...
> b) i should better use my custom router class instead, and redirect
> would be possible here (and not into route itself)
> c) i should do the checking before URL goes to router (maybe on
> bootstrap)
> d) other option i may miss now

I had the same problem. I have created a redirect controller action
that use the redirector action helper to do redirection. This means
that in the router I forward the request to my redirect controller
action and it will redirect the client to the right url.

I don't like this solution very much. I would prefer option (a) but it
seems not work.

Marco

没有评论: