If you want your users to be redirected straight to the Login page, rather than the Homepage, do the following:
Right at the begining of the index.php file , add this code after the 'require_once("mainfile.php");' line, like this:
require_once("mainfile.php");
global $user;
if(!is_user($user)) {
header("Location: modules.php?name=Your_Account");
}
This will send anyone who is not logged in (or registered) to the Your Account (Login) page. See Section 18.6.1 for the inverse procedure - but don't
try both.