I was wrong in my original post.
If I use the php header("Location: "), the back button will be OK.
Although the javascript: document.location.href="" may work in the same as the header("Location: "). But it does work funny and differently in many different browsers such as the back button function etc.
I will use the header("Location: ") to redirect from now on.
I used to use javascript redirect before to avoid the php header error by using header("Location: "). But now I think use the header("Location: ") will force us to use better programming practice to avoid header already sent error.