Welcome Guest, Not a member yet? Register   Sign In
Controller Based 404
#31

[eluser]theQco[/eluser]
The problem I have been having with the redirect() method is that I can't access the URI data. So I can't redirect to certain pages based on the URI that caused the 404.

Thoughts?
#32

[eluser]wiredesignz[/eluser]
The URI object is loaded by the Router object.

If Router is loaded you can access URI data. Check out system/libraries/Router.php

Router is accessible via its global variable $RTR until the Controller is loaded:
Code:
global $RTR;
$uri_string = $RTR->uri->uri_string();
#33

[eluser]Alan Wizemann[/eluser]
Why not? You can process the HTTP server data to get the path, do what you need to do to it, and then redirect based on a switch or method of your choice...
#34

[eluser]wiredesignz[/eluser]
Quote:Why not?

Because "HTTP Server data" may be altered by using $route(s), then $URI->rsegments() is needed.




Theme © iAndrew 2016 - Forum software by © MyBB