I am doing a project in CodeIgniter and I want to route all the urls of a particular controller to a specific action except one. For e.g., I want the url
myurl/mycontroller/myaction
to be handled by the action myaction
but any other urls like
myurl/mycontroller/myaction1
myurl/mycontroller/myaction2
myurl/mycontroller/myaction3
to be handled by action abc
of a particular controller. I had searched across the internet and what I get is how to handle all urls by a certain controller except some. The way to do it is
$route['^(?!admin|user|setup|pages).*'] = "user/view/$0";
Here all urls will be handled by user/view
except those whose 2'nd part of the url is admin
, user
, setup
or pages
.