Where do you use the command header()?
I have the following code at handlers/handle_login.php. The user has gone to the site from index.php
which is the starting place.
if(!$logged_in){
header("Location: index.php");
die("You are not logged_in");
}
If if-clause is true, I get a 404 error, since the header puts me to to handlers/index.php
, instead of index.php
.
Location
header before it gets sent to the client. The browser is either interpreting the current context to behandlers/
, or your environment has some awesomeLocation
header translation that I totally need, because I am sick of devising ways to dynamically create absolute URIs.