[eluser]PhilTem[/eluser]
Well yeah, then it's obvious why your code isn't working. Just as @siptik said you need to create a route called
Code:
$route['.+'] = 'main/index/$1';
which will route every request to your page to the main controller's index() method and will pass the uri segments as arguments in order of appearance in the URI.
What your code does is nothing else than allowing URIs like this
Code:
www.example.com/main/index/<username>
which, however, is not what you intentionally wanted