[eluser]Michael Wales[/eluser]
You will create a controller/method to handle this - let's just say the user has already logged in and the url
example.com/walesmd/codeigniter will take me to my dashboard which is found at Projects->index(). You would establish the following route:
Code:
$route['[(a-zA-Z0-9-)+]/[(a-zA-Z0-9-)+]'] = 'projects/index/$1/$2';
Which will direct the request to:
Code:
class Projects extends Controller {
function index($username, $project) {
}
}
Now, the only thing you have to worry about is your non-dynamic URIs. Let's say you have an about page at
example.com/about that points to Pages->about(). The previous routing rule will instead send that request to Projects->index('about') - not what we want. So, for all of your non-dynamic routes you will need to create a routing rule as well, higher in the list than the dynamic route:
Code:
// This list should go from most specific to least specific, as top rules take precedence.
$route['about'] = 'pages/about';
$route['[(a-zA-Z0-9-)+]/[(a-zA-Z0-9-)+]'] = 'projects/index/$1/$2';
$route['[(a-zA-Z0-9-)+]'] = 'users/settings/$1';