Salman Asmat
Salman Asmat

Reputation: 44

How to do a redirect to another page in CodeIgniter

Hi I want to redirect out of CI project folder.

CI Dir : http://example.net/folder1/folder2/folder3/

Dir I want to redirect to : http://example.net/folder1/folder2/

Here is my Function I'm using for redirection.

public function load_website(){

    $this->load->helper('url');
    redirect('http://example.net/folder1/folder2/','refresh');
}//

This function is not working and stays inside of CI dir.

Positive help will be appreciated. Thanks

Upvotes: 1

Views: 697

Answers (2)

Aisthesis Cronos
Aisthesis Cronos

Reputation: 113

Redirect will refrech content because it stimulate a new call So I think you need to do:

redirect ('folder1/folder2');

Upvotes: 1

Gyandeep Sharma
Gyandeep Sharma

Reputation: 2327

Try this

$this->output->set_header("Location:Enter Path");

Upvotes: 1

Related Questions