location.replace()?

URL移動するとき、Javascriptでは

location.href="url文字列";

で行っていましたが、こちらのほうがいいの?
試してみること。

またパス名のプロパティがlocationにあることも分かりました。
その名はpathname

location.pathname;
document.write(location.pathname;);