location.href.replace
var request_head = 'https://www.dns.la';
if (request_head == 'http://www.dns.la') location.href = location.href.replace('http://www.dns.la', 'https://www.dns.la');
if (request_head == 'http://dns.la') location.href = location.href.replace('http://dns.la', 'https://dns.la');
请问这一段代码有什么作用呢