making login redirection work relative to location