Posted On: Nov 17, 2022
We can use redirect helper to do 301 redirects in Codeigniter.
Syntax :
redirect($uri = '', $method = 'auto', $code = NULL)
Parameter:
$uri (string) – URI string $method (string) – Redirect method (‘auto’, ‘location’ or ‘refresh’) $code (string) – HTTP Response code (usually 302 or 303)
Return type: void
Sample Usage:-
redirect('/posts/13', 'New location', 301);
Never Miss an Articles from us.
What is the current version of Codeigniter?..
How to check the version of CodeIgniter framework?..