[eluser]Phil Sturgeon[/eluser]
It wouldnt get to the controller, as the username would be used as the controller name and a 404 would be returned.
You could use routes, but then EVERY 1 uri segment will be checked as a username.
The way I like to do this is to add a URL suffix in the config file (meaning add .html or similar to all your pages) then use the following mod)_rewrite rules:
Code:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9_-]+)$
RewriteRule ^(.*)$ index.php/profiles/view/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
That is basically a standard CI .htaccess with an extra rule in it. Any URI segment 1 with a-z, 0-9, - or _ in it which does NOT have a URL suffix will go to a controller which will take the username and show the correct profile.
If you have mod_proxy enabled you could even swap the flag [L] with [L,P] to make the URL stay as example.com/username.