[eluser]xwero[/eluser]
If your site is in a subdirectory of the root you can't remove the directory.
To remove the index.php you have to use a empty string for the index_page page setting in config.php and use an .htaccess file to let the server redirect all urls to the index.php files.
The anchor function is a disguised site_url function that generates an a tag. If you want to use the domain of the url you can use this function.
Code:
function domain($url='')
{
$parts = parse_url(config_item('base_url'));
$return = $parts['scheme'].'://'.$parts['host'];
if( ! empty($url)){ $return .= '/'.$url; }
return $return;
}