Let me try and explain as best as I can,
I have the following code in my login.php:
if(isset($_SESSION['user'])!="")
{
header("Location: home.php");
}
This ensures that if a user has logged in successfully, the url will always display mysite.com/home.php on all pages, this works fine for all php redirects using href="another_page".
However this does not work for javascript redirects using window.top.location.href="another_page", this instead redirects with the full url name (eg: mysite.com/java_redirected_page) instead of mysite.com/home.php. How can I get javascript redirects to work with headers as well, just like php does.