Why am I unable to login after converting to www?

You don’t need a rewrite rule in .htaccess to add www back in. Remove the rewrite rule, remove all the defines in wp-config and try to login. If that doesn’t work, delete permalinks in .htaccess to force them back to default.

After you’re in, add the www in Dashboard>>Settings and save. Then reset permalinks.