Welcome Guest, Not a member yet? Register   Sign In
route question
#1

[eluser]quasiperfect[/eluser]
hi

in my routes.php i have something like this where a,b etc are longer names

Code:
$route['(\w{2})/(a|b|c|d)/(a|b|c|d)(.*)'] = "a/b$1";

the controller a with function b exists and if i call
Code:
http://domain.com/en/a/b
in url it works
but i want to be able to call
Code:
http://domain.com/en/b/b/c/d/e
etc
what i'm doing wrong ?
#2

[eluser]toopay[/eluser]
You need to add "/". Also you should set up for each tier of your url (you can use shorthand (:any) too)
Code:
// If you want more tier in your url, just define another...
// for 4 tier url, like http://domain.com/en/a/b/c/d/foo
$route['(\w{2})/(a|b|c|d)/(a|b|c|d)/(a|b|c|d)/(a|b|c|d)/(:any)'] = "a/b/$1";
// for 3 tier url, like http://domain.com/en/a/b/c/foo
$route['(\w{2})/(a|b|c|d)/(a|b|c|d)/(a|b|c|d)/(:any)'] = "a/b/$1";
// This will only work for 2 tier url, like http://domain.com/en/a/b/foo
$route['(\w{2})/(a|b|c|d)/(a|b|c|d)/(:any)'] = "a/b/$1";




Theme © iAndrew 2016 - Forum software by © MyBB