Redirect ip to url
===

I want to redirect from my ip(A host) to my website url. Earlier I used the following lines in the .htaccess file and it worked fine. 

    RewriteCond %{HTTP_HOST} ^[0-9]+(\.[0-9]+){3} [OR]
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule ^ http://example.com/$1 [L,R=301]
The above code redirected my ip to the web url.

Now I changed the code to the following and the ip redirects to a weird url
 
    RewriteCond %{HTTP_HOST} ^[0-9]+(\.[0-9]+){3} [OR]
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

I want to use the {REQUEST_URI} feature and at the same time redirect to my base url. What is the correct syntax to do that ?

Thanks in advance...