Reputation: 79349
I'm redirecting a user on a website from one page to another by using:
window.location.href = "http://page.com/new_url";
But problem is that sometimes website is accessed from HTTP, but sometimes from HTTPS.
How do I make the redirect work and preserve the protocol?
Upvotes: 2
Views: 174