Using .htaccess to redirect traffic causes a redirect loop

I am trying to redirect users to a different url when they access my web application from a particular url. For example, if they use To visit the web application, I want to redirect them to

This is my .htaccess case file:

RewriteEngine On
    RewriteCond %{HTTP_HOST} !$ (NC)
    RewriteRule ^(.*)$$1 (L,R=301)

When I access the site using redirects to but repeatedly concatenates it in the url bar. For example: etc.

I also get the error ERR_TOO_MANY_REDIRECTS.