If you are looking for a fast way to URL shorten with CodeIgniter you are in luck.
Basically you set your routes (application->config->routes.php) $route[‘404_override’] to point to the controller and action which directs shorten URLs
e.g. in you routes file:
$route['404_override']='short_links/retrive';
Then short_links has a function retrive
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Short_links extends CI_Controller { function retrive() { $this->load->model('shorten_urls');//load the model which looks after the URLs $url = $this->uri->segment(1);//get the URL segment e.g. abc redirect($this->shorten_urls->get_url($url)); //lookup the original URL and redirect } }