Basic index($variable) question for creating a site like www.mysite.com/username |
[eluser]AlanW[/eluser]
[quote author="AlanW" date="1352755256"][quote author="AlanW" date="1352754869"]Thanks! [quote author="siptik" date="1352754725"]try this: Code: $route[‘default_controller’] = “main”; Do you mean 'set route $route["(:any)"] = ‘main/index/$1’ …? [/quote] Actually, I wondered if you need the word 'set' … or route. It looks like the other lines start with $route so I'll try adding: $route["(:any)"] = ‘main/index/$1’; [/quote] Thanks again. I am really trying to understand the (:any) piece here to get my www.mysite.com/username and also allow other controllers. It doesn't appear to me that what I want to do is an easy task. For others, I'm including this reference here: At http://ellislab.com/codeigniter/user-gui...uting.html they describe this: $route['product/(:any)'] = "catalog/product_lookup"; A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method. $route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; A URL with "product" as the first segment, and a number in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function. |
Welcome Guest, Not a member yet? Register Sign In |