The difference is in the recipient $location.url() and $location.path()
The url () URL returns the path, search, and hash of the form /path?search=a&b=c#hash , while path() returns only /path .
In terms of redirection, if this is just the way, then yes, I would use
$location.path(redirectpath).
You can learn more about $location docs
source share