![]() |
Catch n check $this->uri->segment(?) - 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: Catch n check $this->uri->segment(?) (/showthread.php?tid=36026) |
Catch n check $this->uri->segment(?) - El Forum - 11-18-2010 [eluser]Circuitbomb[/eluser] Ok so maybe my title was a bit confusing. Using the default controller set in CodeIgniter I'm looking to catch a url similar to http://mysite.com/index.php/4348q34 using code that looks like: Code: if($this->uri->segment(1) === TRUE) { in the construct of the default controller. my_library is being loaded. Basically, what im trying to do is check to see if the uri segment 1 or 2 exists within the default controller, and if it doesnt to process a method in my library to initialize a redirect to an external site. any ideas? Catch n check $this->uri->segment(?) - El Forum - 11-18-2010 [eluser]Circuitbomb[/eluser] Ok I managed to hack it up looking at http://ellislab.com/forums/viewthread/103349/P30/ and sending the request to a function that looks like Code: function process($string) { It looks good so far, except I don't get the 404's from no match uri's in which case i can simply direct it in else. |