• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Controller

#1
I have to remove controller name from the URL in CodeIgniter for my website but my others controller is not working .
its showing this message " The page you requested was not found ".

I used following code for remove my website controller name from routers.php:

$default_controller = "webportal";
$route['default_controller'] = $default_controller;
$controller_exceptions = array('admin','email');

$route['default_controller'] = $default_controller;
$route["^((?!\b".implode('\b|\b', $controller_exceptions)."\b).*)$"] = $default_controller.'/$1';
$route['404_override'] = '';
Reply

#2
read this http://www.web-and-development.com/codei...imize-url/



hope it will solve ur problem...
Reply

#3
You can set your a route for each url:
In your config/routes.php file, just set each page like this:

$route['ci/home'] = "ci/site_controller/home";
Done.
Reply

#4
Multiple routes can be set as follows:

$xs=array
('overloaded', 'hs-pix', 'Health-and-Safety-Pictures', 'health-and-safety-pictures',
'health-and-safety', 'safety-at-work', 'safety_at_work',
);
foreach($xs as $x):
$route[$x] = "c_pix/safety";
endforeach;
download and make your system directory strict
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.