Welcome Guest, Not a member yet? Register   Sign In
Problem: Routing Using Wild Cards
#10

[eluser]Shiju S S[/eluser]
The problem was in RegEx as explained by Sr. Research Associate CroNiX.

I got it corrected with the following route:

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$route['default_controller'] = "frontarea/frontpage";
$route['404_override'] = '';
$route['home'] = "frontarea/frontpage";

// Admin Area
$route['(^admin+:any)/(:any)/(:any)/(:any)'] = 'adminarea/$1/$2/$3/$4';
$route['(^admin+:any)/(:any)/(:any)'] = 'adminarea/$1/$2/$3';
$route['(^admin+:any)/(:any)'] = 'adminarea/$1/$2';
$route['(^admin+:any)'] = 'adminarea/$1';
$route['(^admin+)'] = 'adminarea/$1';

// Franchise Area
$route['(^franchisee+:any)/(:any)/(:any)/(:any)'] = 'franchiseearea/$1/$2/$3/$4';
$route['(^franchisee+:any)/(:any)/(:any)'] = 'franchiseearea/$1/$2/3';
$route['(^franchisee+:any)/(:any)'] = 'franchiseearea/$1/$2';
$route['(^franchisee+:any)'] = 'franchiseearea/$1';
$route['(^franchisee+)'] = 'franchiseearea/$1';

// staff Area
$route['(^staff+:any)/(:any)/(:any)/(:any)'] = 'staffarea/$1/$2/$3/$4';
$route['(^staff+:any)/(:any)/(:any)'] = 'staffarea/$1/$2/3';
$route['(^staff+:any)/(:any)'] = 'staffarea/$1/$2';
$route['(^staff+:any)'] = 'staffarea/$1';
$route['(^staff+)'] = 'staffarea/$1';

// front Area
$route['(^front+:any)/(:any)/(:any)/(:any)'] = 'frontarea/$1/$2/$3/$4';
$route['(^front+:any)/(:any)/(:any)'] = 'frontarea/$1/$2/3';
$route['(^front+:any)/(:any)'] = 'frontarea/$1/$2';
$route['(^front+:any)'] = 'frontarea/$1';
$route['(^front+)'] = 'frontarea/$1';

The [] around the name caused the problem. eg: [admin]+

Thanks for the support.


Messages In This Thread
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 03:02 AM
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 03:18 AM
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 03:26 AM
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 10:57 AM
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 11:22 AM
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 03:49 PM
Problem: Routing Using Wild Cards - by El Forum - 12-15-2012, 10:57 PM
Problem: Routing Using Wild Cards - by El Forum - 12-16-2012, 12:27 AM
Problem: Routing Using Wild Cards - by El Forum - 12-16-2012, 12:36 AM
Problem: Routing Using Wild Cards - by El Forum - 12-16-2012, 01:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB