# Remove /author/ from the author profile url

I'm trying to figure out the best way to remove /author/ from the profile URL of my users. I tried using the method in the link below and although it worked, it also prevented me from accessing any of my other pages that used a page template. So not sure if there's a tweak I need to make to the code?

I would like to do this through the functions file and not use a plugin so any guidance is much appreciated.

add_action('init', 'cng_author_base');
function cng_author_base() {
global $wp_rewrite;$author_slug = ''; // change slug name
$wp_rewrite->author_base =$author_slug;
}