SOLVED - Redirect problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: SOLVED - Redirect problem (/showthread.php?tid=18369) |
SOLVED - Redirect problem - El Forum - 05-04-2009 [eluser]RJ[/eluser] Hello, Using the code below I've narrowed down an issue i am having to a redirect problem Code: $redirect = ''.$this->lang->lang.'/shop/device/'.$this->dealer->dealer.'/plan'; Looks all goofy because I've been trying to break it down to the error. It appears the /plan part of the URI is not being passed! I see it in the log Quote:REDIRECT :en/shop/device/999/plan Here is the method handling the request: Code: function device($dealer = '999', $page = 'personal_information') Log shows I get all the way to the redirect then am sent to a 404 error rather than the specified URL. In the browser bar the /plan part is missing. Any thoughts? SOLVED - Redirect problem - El Forum - 05-04-2009 [eluser]TheFuzzy0ne[/eluser] That's a strange one. Even without the last parameter, your controller method should set $page to the default "personal_information", but it certainly shouldn't show a 404 error. I can only conclude that the redirect URL is somehow wrong, or that you have a route interfering somewhere. What changes do you have to make to the URL in your browser's address bar to make it work? SOLVED - Redirect problem - El Forum - 05-05-2009 [eluser]RJ[/eluser] The solution may be one of many changes I made; most notably using "refresh" in the redirect. Code: redirect($redirect, 'refresh'); Also moving the form validation library load into the page switch rather than loading globally for the device method likely contributed. Code: case "personal_information": Finally I was able to trouble shoot by adding a $debug to the methods params like: Code: function device($dealer = '999', $page = 'personal_information', $debug = FALSE) Calling upon a class var, setting TRUE if debug is TRUE: Code: if($debug == true) {$this->error_debug = true;} Note I can only properly access the debug by completely filling out the URL like: Code: s/en/shop/device/personal_information/999/debug Finally debug usage example: Code: if($this->error_debug) Hope this helps someone. Best |