I am trying to secure the qa site to ensure that only the logon users are able to access the site. The site is integrated with WordPress.
I am using the following script at the beginning of qa-index.php.
global $qa_login_userid;
if (isset($qa_login_userid)) {
// user is logged in
exit;
} else {
// no user is logged in
header("Location: http://www.mybrainsfood.com/wp-login.php");
};
The problem is, both cases the redirection will be executed. Can someone guide me please?
Thank you.