Redirect to another application Codeigniter

1

I have a codeignter with 3 applications, inside each the default welcome view, the structure looks something like this:

  • www

  • applications

    • site
    • site2
    • site3
  • system

I need to figure out how to redirect to site2 for example from site 1

    
asked by anonymous 04.06.2018 / 16:46

2 answers

1

Adriano,

One suggestion is to use the header function, pointing to the URL of the application to be redirected:

header('Location: http://www.example.com/');
header('Location: https://pt.stackoverflow.com');

It's a simple, native PHP solution that allows you to redirect. For more information, the PHP documentation explains some more details.

    
05.06.2018 / 21:22
0

Controller Site 1 to call site 2

 public function redirecionar() {
        redirect('nomecontrollersite2/indexsite2');
     }

Controller Site 2

  public function indexsite2() {
          $this->load->view('indexsite2',);
}
    
04.06.2018 / 18:23