--------------------------- <a id=linky href=""></a> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(document).ready(function() { if (window.location.href.indexOf("alceawisteria") > -1) { //alert("your url contains the name franky"); document.getElementById('linky').click(); window.history.back(); window.close(); } }); </script> (put script part at very end of page to make it work) (Source: https://stackoverflow.com/questions/4597050/how-to-check-if-the-url-contains-a-given-string ) </plaintext>