Any way to reroute a path to a file on the webserver either with Fuel or Codeigniter?
I have a need to redirect users from an old path location for an XML file to a new path location. The old location is /stations/bikeStations.xml and the new path is /data/stations/bikeStations.xml.
I've tried adding this custom route in the routes file, but it doesn't appear to work:
$route['stations/bikeStations.xml'] = 'data/stations/bikeStations.xml';
I also have a stations controller, in which I inserted the following code to check the 2nd URI segment to try and redirect them to the new location that way:
if($this->uri->segment(2) == 'bikeStations.xml')
{
redirect('data/stations/bikeStations.xml');
}
Why wouldn't this work? I understand it is a Codeigniter thing, but I'm wondering why file references are not supported with the URI routing class in Codeigniter. Perhaps Fuel has something that can work in this case?
Thanks,
Erik
Comments