Welcome Guest, Not a member yet? Register   Sign In
Problem with redirect and routes
#4

(This post was last modified: 03-27-2021, 07:56 AM by mlurie.)

First you will need to make sure make sure automatic routing is enabled and/or you have defined your custom routes in app\Config\Routes.php.  You can find the documentation here: https://codeigniter.com/user_guide/incom...uting.html.

To redirect to a specific route try the following from your controller:

PHP Code:
return redirect()->to('my_uri'); 

"my_uri" should be a route that is defined in your Routes.php file or correspond to an automatic route (e.g. 'users/profile', 'dashboard', 'blog/post/1234', etc.)
Reply


Messages In This Thread
Problem with redirect and routes - by Madsex - 03-26-2021, 10:25 AM
RE: Problem with redirect and routes - by Madsex - 03-27-2021, 04:05 AM
RE: Problem with redirect and routes - by mlurie - 03-27-2021, 07:39 AM
RE: Problem with redirect and routes - by wdeda - 03-27-2021, 09:03 PM
RE: Problem with redirect and routes - by Madsex - 03-28-2021, 04:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB