routing problem |
[eluser]Gewa[/eluser]
How to make such routing that www.site.com/sites/userX/controller/function/var1/var2 will behave like it was www.site.com/controller/function/var1/var2 ???
[eluser]WanWizard[/eluser]
Something like Code: $route['sites/user(:any)/(.*)'] = '$2';
[eluser]Gewa[/eluser]
userX can be ANY username , but the routing you gave didn't worked
[eluser]mddd[/eluser]
The route doesn't work because 'any' can match more than a single uri segment. If you write the route differently it will probably work: Code: $route['sites/([^/]+)/(.*)'] = '$2';
[eluser]WanWizard[/eluser]
@mddd: I don't use routes myself, and the manual explicitly talks about segment (singular) when referring to (:any) and (:num). Learning all the time. ![]()
[eluser]mddd[/eluser]
I agree. The manual is unclear. I have suggest before that there should be another 'wildcard' for a SINGLE segment. It seems that most developers don't know that :any matches more than one segment. Of course, to be backwards compatible, :any should stay the way it is, maybe ![]()
[eluser]Clooner[/eluser]
[quote author="mddd" date="1279713749"]I agree. The manual is unclear. I have suggest before that there should be another 'wildcard' for a SINGLE segment. It seems that most developers don't know that :any matches more than one segment. Of course, to be backwards compatible, :any should stay the way it is, maybe ![]()
[eluser]Gewa[/eluser]
I made a topic by mistake, the main thing is that with your solution I have such problem. Code: $route['sites/([^/]+)/(.*)'] = '$2'; By idea when I go to www.site.com/sites/sitename/ then the base_url=http://site.com/sites/sitename/ and I want that then default page that would be loaded is what I see when i go to www.site.com/sites/sitename/content/ But I get just 404 What to do? |
Welcome Guest, Not a member yet? Register Sign In |