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

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


// Franchise Area

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

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

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

URLs like
Quote:adminreports/printreport/1
franchiseereports/printreport/1
is working correctlyis working correctly

but
Quote:frontpage/printreport/1
staffreport/printreport/1
is not working

When I placed the staff part in the top it is working !
What I could under stand is that only the first 2 sections is routing correctly. After that I am getting a
404 Page not found error.


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