0
I wish that if there was no string in the url, it would redirect to a page. This is what I tried
$(document).ready(function () {
    if(!window.location.href.indexOf("www") > -1) {
        var link = window.location.href;
        var ver = link.substr(link.indexOf("index.php"));
        window.location.href="https://www.famalicaocanal.pt/"+ver;
    }
});
With the above code it works but it always continues to refresh the page even if it exists www at the url.
Worked perfectly!
– I_like_trains