I want the page to redirect to https://example.com if the domain is not on either https://example.com or https://example.site or https://example.page. So far I tried this:
if(location.host != "example.com", "example.site", "example.dev") {
window.location.replace("https://example.com");
}