routing question

Is it possible(with CodeIgniter) to set up a site similar to twitter in that you can find different profiles at I have a database full of profile users and their information but would love to instead of this

routed to this

But im not seeing how thats possible if i have folders at my root like 'myfolder' in my example. Hope that made sense!

you can achieve that with routes

I would use when setting up your routes to avoid ambiguity. You may have to disallow certain usernames if you don't, depending on how you have your site set up.

Yeah i think its going to be easier if i use '/user/' bkaxrf.

Flaky, i read the guide and don't see how i can use a username where i want it because where i want it is where classes usually go...thats why i asked.

you would achive that like this, it's very basic far from perfect or for use in production

//redirect to controller user
$route[":any"] = "user/profile";

$route[':any'] = "usercontroller/viewprofile/$1";

This should do what you want, although I haven't tested it. You'll have to change the controller and function, obviously.

that makes sense...let me know if this makes sense

1. reserve some usernames for my folder names
2. have that route to like you both wrote
3. in my viewprofile page i would need some code that would check to see if that username exists and if not check to see if its a folder and send to that folder.

im just worried about my folders that i have at the root being mistaken as users

im learning on my hosted account which already has my website coded in the non-framework/procedural way so i have folders where i store all of my files in. So for example i store just about all of my files in a folder ive called 'main'

i don't want that to be redirected to a profile page.

or this either...

it is far better to use ‘/user/' as bkaxrf said

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.