Welcome Guest, Not a member yet? Register   Sign In
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, 03:12 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 03:29 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 03:38 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 04:03 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 04:18 PM
Rewrite url or use routing - by El Forum - 03-02-2012, 06:13 PM
Rewrite url or use routing - by El Forum - 03-03-2012, 01:22 AM
Rewrite url or use routing - by El Forum - 03-03-2012, 08:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB