views:

26

answers:

1

Hi ,

i am using mason 1.0 and want to redirect the page to another URL.

Is there any way to redirect ?

Alternatively..

I have written following code in dbhandler which is giving error stating that $r undefined. Can you please help.

  $r->method('GET');
  $r->headers_in->unset('Content-length');
  $r->content_type('text/html');
  $r->header_out('Location' => $newPageURL);
  $m->abort(301);

I cannot use $m->redirect as it is not avalible to me. I am referring http://www.masonhq.com/?FAQ:HTTPAndHTML#h-how_do_i_do_an_external_redirect_

A: 

Looks like $m->clear_buffer is missing before your first call.

It's required so it wipes out any response generated before you reach your redirection.

jeje