location.href = location.href.replace(/(https?:\/\/)[^/]+/,'https://portal.coree.cc');
Tips and References