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

[eluser]Shiju S S[/eluser]
I have redefined the routes as
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]+[a-z_]+)/(:any)/(:any)/(:any)'] = 'adminarea/$1/$2/$3/$4';
$route['([admin]+[a-z_]+)/(:any)/(:any)'] = 'adminarea/$1/$2/$3';
$route['([admin]+[a-z_]+)/(:any)'] = 'adminarea/$1/$2';
$route['([admin]+[a-z_]+)'] = 'adminarea/$1';

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

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

// front Area
$route['([front]+[a-z_]+)/(:any)/(:any)/(:any)'] = 'frontarea/$1/$2/$3/$4';
$route['([front]+[a-z_]+)/(:any)/(:any)'] = 'frontarea/$1/$2/3';
$route['([front]+[a-z_]+)/(:any)'] = 'frontarea/$1/$2';
$route['([front]+[a-z_]+)'] = 'frontarea/$1';
Still the problem persists.
The controllers in admin area and franchiseearea is working well.
Staff area and front area is showing 404.

The reason why I am getting upset is, when I changed the order to:
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$route['default_controller'] = "frontarea/frontpage";
$route['404_override'] = '';
$route['home'] = "frontarea/frontpage";

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

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


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

// Franchise Area
$route['([franchisee]+[a-z_]+)/(:any)/(:any)/(:any)'] = 'franchiseearea/$1/$2/$3/$4';
$route['([franchisee]+[a-z_]+)/(:any)/(:any)'] = 'franchiseearea/$1/$2/3';
$route['([franchisee]+[a-z_]+)/(:any)'] = 'franchiseearea/$1/$2';
$route['([franchisee]+[a-z_]+)'] = 'franchiseearea/$1';
Front and Staff is working. Now admin and franchisee is not working.


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