<script> var some_val = false; if (some_val) { window.location = "/other.html"; } </script> Test Content <a href="/some/path/another.html">Some Link</a>