Use $state.href
to get the url:
$rootScope.$on('$stateChangeSuccess', function (ev, to, toParams, from, fromParams) {
// $state.href(from, fromParams)
});
You can also pass options as a third paramerer.
Read the Docs for more information.