admin toolbar missing when editing .htaccess file to rewrite www to non-www

Permalink
I followed this link for re-routing www to non-www:

http://richardjh.org/blog/ten-things-you-should-do-when-using-concr...

by inserting this code in my .htaccess file

# Rewrite www to non-www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.mycompany.com [NC]
RewriteRule ^(.*)$http://mycompany.com/$1 [L,R=301]

And now the Concrete5 tools along of the top of the website when logged in as admin are gone. The header is still there, but nothing inside. What am I doing wrong?

If I remove the code in .htaccess above, everything works as it should.

If I then log out as admin, then change the .htaccess file by including the lines above, then attempt to log in as admin, I observe:

The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying
to use an ErrorDocument to handle the request.