Use getAbsoluteUrl for redirection URL

Also separate the function into getDefaultPageUrl() and
redirectToDefaultPage() to make it testable.