Must 怎么 be right after 你 in this sentence: 你怎么知道我的名字
什么 is a modifier for 名字 in 你叫什么名字
怎么 is a modiifer for 知道 in 你怎么知道我的名字
You cannot move 怎么 in the sentence. And you can see that they are actually of different structure.