Welcome Guest, Not a member yet? Register   Sign In
custom users routes? [SOLVED]
#1

[eluser]dootzky[/eluser]
Hi guys,

I developed over 30+ sites in CI, and I love it! Smile
Now, I have a specific request, which is giving me routes-problem.

There is this site, let's call it:
www.site.com

ok, now, every USER on that site, should have a custom URL, for *all of his pages*. Here's an example:

www.site.com/john/
www.site.com/barbara/
etc.

ok, so - this would be easy, if it was a "single page for each user", so I could easily rewrite /config/routes.php to interpret something like this:

www.site.com/profile/john/ -> www.site.com/john/
www.site.com/profile/barbara/ -> www.site.com/barbara/
etc.

ok, that would be easy. BUT, what I really need to do, is to make their username *part of their URL*, so that they have other pages, like they have multiple CI instances, but it's only a URL trick. So, I need to be able to route these pages as well:

www.site.com/john/contact_us
www.site.com/john/product/123
www.site.com/john/news
www.site.com/barbara/contact_us
www.site.com/barbara/news
etc.

get it? Smile

So, basically, what I need to do is: to have only one instance of my CI, and to find a way to put username in the URL, so that it acts like it's a base_url(), but the real application code is in the root of the "www.site.com", of course.

Is that doable? :|

I know that I can add suffix on every URL, transfering their username that way, for example:
www.site.com/contact_us/john
www.site.com/contact_us/barbara
etc.

but I don't want that, I need to make the URLs very user-friendly so that they can share their "mini websites" with short and simple URLs.

Any way for this to be done?
Thanks for your time and effort upfront guys, I really appreciate it. Smile

Cheers from Europe,
Dushan

p.s. perhaps something can be done similar to the "multilanguage URL hack" like in the CI Wiki? http://codeigniter.com/wiki/i18n_Multi-l...ry_Helper/ ?? Something like that?


Messages In This Thread
custom users routes? [SOLVED] - by El Forum - 10-14-2010, 07:39 AM
custom users routes? [SOLVED] - by El Forum - 10-14-2010, 05:26 PM
custom users routes? [SOLVED] - by El Forum - 10-14-2010, 10:29 PM
custom users routes? [SOLVED] - by El Forum - 10-15-2010, 07:23 AM
custom users routes? [SOLVED] - by El Forum - 10-15-2010, 10:19 AM
custom users routes? [SOLVED] - by El Forum - 10-15-2010, 10:57 AM
custom users routes? [SOLVED] - by El Forum - 10-16-2010, 12:08 PM
custom users routes? [SOLVED] - by El Forum - 10-16-2010, 12:34 PM
custom users routes? [SOLVED] - by El Forum - 08-03-2011, 05:25 PM
custom users routes? [SOLVED] - by El Forum - 08-04-2011, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB