what happen is error with redirect to codeigniter 4.3.3 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: what happen is error with redirect to codeigniter 4.3.3 (/showthread.php?tid=87286) |
what happen is error with redirect to codeigniter 4.3.3 - startup - 04-04-2023 i have function below, but redirect() ->to('auth/home'); dont work, can someone show me what is error? Code: 404 PHP Code: public function check(){ thank you for reading RE: what happen is error with redirect to codeigniter 4.3.3 - Muzikant - 04-19-2023 Hi. Check if you have correctly set destination route auth/home in app/Config/Routes.php. It could be something like this: PHP Code: $routes->get('auth/home', 'Auth::home'); You could also check if you have correct variables $baseURL and $indexPage in app/Config/App (or in .env file if you are using it), because redirect()->to() is based on these values. If it does not work, then try only redirection on a fresh CodeIgniter's installation. app/Config/App.php PHP Code: // ... app/Config/Routes.php PHP Code: // ... app/Controller/Home.php PHP Code: // ... Access this URL in a web browser (based on $baseURL): http://localhost:8080/from and watch if it is working. If it will work, then the problem is somewhere in your code or settings. RE: what happen is error with redirect to codeigniter 4.3.3 - SubrataJ - 04-19-2023 if you are using validation, it is pretty much sure you want to g back to the same page with the validation error in this case instead of using PHP Code: return redirect()->to() PHP Code: redirect()->back() Code: php spark routes for more info check redirect-and-validation-errors RE: what happen is error with redirect to codeigniter 4.3.3 - byoosdigital - 04-22-2023 thjs code under line working good
header("Location:".base_url('login'));
RE: what happen is error with redirect to codeigniter 4.3.3 - SubrataJ - 04-22-2023 (04-22-2023, 02:29 AM)byoosdigital Wrote: your code won't work until you use die or exit after header function. RE: what happen is error with redirect to codeigniter 4.3.3 - byoosdigital - 04-24-2023 (04-22-2023, 02:29 AM)byoosdigital Wrote: |