Thank you for reacting on my question. I don't know how to use your suggestion. In my .htaccess I don't have text like:
old redirect, failed, could not log in
#RewriteCond %{HTTP_HOST} ^domainname\.com$ [NC]
#RewriteRule ^(.*)$
www.domainname.com/$1 [R=301,L]
new code, I could log in again
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^domainname\.com
RewriteRule (.*)
domainname.com/$1 [R=301,L]
Can you please explain a little bit more. Excuse my late reaction. I had holiday.