This is pretty easy with httr:
library(httr)
HEAD("http://gmail.com")$url
You will probably also want to check the status_code
returned by HEAD, as failures often won't be redirected.
(One advantage of using httr over RCurl here is that it automatically preserves the connection across multiple http calls to the same site, which makes things quite a bit faster)