var url1 = 'vngkgk.tistory.com'; var url2 = 'twinkleain.com'; var online = document.URL; if(online.match(url1)) document.location.href = online.replace(url1, url2);