I want to convert current url to https version with javascript. How can i done this ?
Ex: http://www.example.com --> https://www.example.com
window.location = window.location.href.replace(/^http:/, 'https:');
If you know that your http URL starts with "http://", then it is as simple as:
var httpsUrl = "https" + httpUrl.substring(4);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With