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

[eluser]decob[/eluser]
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
www.example.com/isacrapwebsitename

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

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

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

[eluser]tkyy[/eluser]
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!
#4

[eluser]decob[/eluser]
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?
#5

[eluser]alrightythen[/eluser]
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.

Thanks.
#6

[eluser]decob[/eluser]
the solution i found on another thread, last item...

http://ellislab.com/forums/viewthread/129407/

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
#7

[eluser]jimps[/eluser]
Sorry for bumping old thread. Many tabs up in my browser.




Theme © iAndrew 2016 - Forum software by © MyBB