I believe you intended to use the asset helper function and not the url function in your layout view. The url function produces the base url, including index.php if the user is not using .htaccess