Welcome Guest, Not a member yet? Register   Sign In
how to put username after domain name

I saw some website deal/groupon can put username after domain name example: www.xyz.com/abc and in my website I want allow some users register nickname and they can post some deals/groupon they want and they access or views these posted by them throught out url like this: www.xyz.com/abc

Futher more how can I show a deal time with day, hour , minute decrease on web page with deal time decrease

Thank you for reading my topic

You can do this with routes, but it would be a bit complicated because you'd be breaking the default way CI maps the url to a controller/method (there would be no controller/method in the url). So you'd need to create a route for every controller that you use, and then at the very end of them have a catch-all route like
$route['(:any)'] = 'controller/method/$1';
Where it would pass whatever was after the domain name in the URL to the 'controller/method' that you want to use.

You need all of the other controllers mapped before that route though, or no other controller could be accessed since it will send everything to that one controller that you want to use to display the profile (or whatever).

@CroNiX: thank you for your fast reply, I will trying about routes

if you can deal with one extra word in the URL it will greatly simplify what you want to do
something like 'users'


and then set up a route like
$route['users/(:any)'] = "users/display";

where your controller is called users, with a method called display, that searches for the user and displays them.
note that - whats cool is that the route can direct to any controller and method, it doesn't need to be the same name,

$route['users/(:any)'] = "customers/find";

CodeIgniter User Guide - Remapping Function Calls

@insiteFX: I will try Remapping Function Calls tk for your reply

Have a look at the appended link, that might give you another approach to solving your problem Wink


I think the solution is here: http://ellislab.com/forums/viewthread/186025/

Theme © iAndrew 2016 - Forum software by © MyBB