How to switch from http to https in a client side script. Do not change the URL otherwise. It should do nothing in https. The server replies the same to http and https. I need the rest of the Original URL to stay intact.
http://example.com --> https://example.com
http://example.com/a --> https://example.com/a
http://example.com/b --> https://example.com/b