I\'m in a situation where I need to rewrite an url in javascript and switch it from http protocol to https.
I can match https urls with:
if(url.match(\'
Cannot it be done by simply replacing the http string?
if(url.match('^http://')){ url = url.replace("http://","https://") }