Question

Current I have URL www.site.com/mauritius/className/function/id. I have managed to remove index.php using .htaccess.

Now I want to remove function segment from URL. I want to make above URL www.site.com/mauritius/className/id. Just don't want 'function' in URL for only one function.

Was it helpful?

Solution

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top