Download file with url redirection

I can download a file by url but when I try it from bash I get a html page instead of a file.

How to download file with url redirection (301 Moved Permanently) using curl, wget or something else?

UPD

Headers from the url request.

curl -I http://www.somesite.com/data/file/file.rar

HTTP/1.1 301 Moved Permanently
Date: Sat, 07 Dec 2013 10:15:28 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3
Location: http://www.somesite.com/files/html/archive.html
Vary: Accept-Encoding
Content-Type: text/html
X-Pad: avoid browser bug

Use -L, --location to follow redirects:

$ curl -L http://httpbin.org/redirect/1