Re-factored the redirection of the pages.