Welcome Guest, Not a member yet? Register   Sign In
personal urls

looking to add a feature for members of a site where they would have a personal url based on their first name, www.example.com/john which would obviously map to the main controller,

Given that the majority of the site is actually flash with some data being pulled in fron codeigniter, i'd need that controller not to be mapped back to the main controller.

At some stage in the future i may check the entered names against a database to ensure it's an allowable name.., as i'd rather not have people being able to enter any random crap like

So question is, whats the best approach, routes or some form of mod_rewrite magic

[eluser]Ben Edmunds[/eluser]
Is this a question?

If you are just asking how to do this, use routes.

i have solved this problem several ways in the past. whatever it is you do make sure you do a scandir of the controllers folder and blacklist any names of files contained there when a user creates his/her account.

don't hardcode it- had this happen to me once!

yeah found one solution that allowed any string to be mapped to a controller, and a blacklist of used contoller names, thinking of also having an allowable list that is checked.
I haven't tried it yet but can i make a db call from the routes.php?

I'm having trouble planning this type of feature. Can someone help me get on my way? How does routes help me?

I want to have these kinds of urls...
http://www.example.com/username -> which are dynamic
http://www.example.com/about -> which are made by me in de controller

What's the best practice for this?

I've been thinking a uri to "members/username" then rerouting to http://www.example.com/username should do the trick but what if the user wants to manually type http://www.example.com/username.

I understand the techniques explained above but I can't find actual information in the user guide or internet to help me get started with this.


the solution i found on another thread, last item...


i'm looking at maybe also having a white list of alloweable names, tho would need to test it for speed as i'd have quite a few names to allow. My concern was people could enter any old crap and it appear as a page

Sorry for bumping old thread. Many tabs up in my browser.

Theme © iAndrew 2016 - Forum software by © MyBB