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 code above it works but it always keeps refreshing the page even if there is www
in the url.