For some reason, after JS redirect at the end of the link may disappear index (WP)?

There is a list
switch(something){
 case "something":
 document.location.href = "thankyou";
break;
 case "something1":
 document.location.href = "thankyou/1";
break;
 case "something2":
 document.location.href = "thankyou/2";
break;
 case "something3":
 document.location.href = "thankyou/3";
break;
.....
}

In the case of thankyou/1 after the redirect remains, thankyou. But if you just go to the link thankyou/1, the unity remains in place. Why and where it disappears?

Alerts checked, he just comes in the right case and performs
document.location.href = "thankyou/1";


Not works /1, the other indexes remain in place

Thanks in advance.
July 9th 19 at 13:57

Find more questions by tags JavaScriptWordPress