set your route in config/routes.php
$route['alias'] = 'controller/method';
or rewrite url using .htaccess
i am not check this but you can try like
RewriteRule ^controller/([a-z0-9A-Z]+)/?$ controller/function/$1 [L,QSA]
For more :- http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/