fix  for issue #21. Redirection works correctly for pages that require a login