• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rewrite url or use routing

#7
[eluser]PhilTem[/eluser]
To sum up previous posts, your routes.php should look like this

Code:
$route['default_controller'] = "home";
$route['404_override'] = '';

//here first I try to get rid of the index but something isn't just right and it is not working...
$route['(bg|eng)/category/(:num)/(:num)'] = "category/index/$3/$4";

// URI like '/eng/about' -> use controller 'about'
$route['^(bg|eng)/(.+)$'] = "$2";

// '/eng' and '/bg' URIs -> use default controller
$route['^(bg|eng)$'] = $route['default_controller'];

If you don't wanna have numeric parts within the /category/-uri, then replace it with either .+ or (:any) and make your category/index-method to translate the given string to a category- or sub-category id respectively.

Code:
//here first I try to get rid of the index but something isn't just right and it is not working...
$route['(bg|eng)/category/(:any)/(:any)'] = "category/index/$3/$4";


Messages In This Thread
Rewrite url or use routing - by El Forum - 03-02-2012, 04:12 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 04:29 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 04:38 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 05:03 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 05:18 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 07:13 PM
Rewrite url or use routing - by El Forum - 03-03-2012, 02:22 AM
Rewrite url or use routing - by El Forum - 03-03-2012, 09:55 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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