1
votes

I have a controller named home, which is my default controller too. This is my path

http://192.168.1.100/FMP/mobile/home/index/suzuki-violin-school--6/102271

Now i am trying to rewrite the url as

http://192.168.1.100/FMP/mobile/suzuki-violin-school--6/102271

Where i need to remove both controller name and function name. So far i tried putting this in route.php

$route['(?!user|product).*'] = "mobile/home/index/";

But it takes all other methods in home controller and other controllers to the index function of home controller. Any thoughts on how can i achieve this?

1
yeah never explicitly call the index method - qwertzman

1 Answers

0
votes

Try this below code in end of your routes.php file

$route['(:any)/(:num)'] = 'home/index/$1/$2';

above route get two parameter and pass it into home page index function and your index function will be ass follow

public function index($parms1,$parms2)

Hope it will solve your problem. If not let me know. I'll happy to guide you through