How to redirect users to the Login page

18.2.1. How to redirect users to the Login page

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:

global $user;
if(!is_user($user)) {
  header("Location: account.html");

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.

See how to redirect from forms in a PHP-Nuke block for redirection from other places, like blocks.


Site Info v2.2.2

Last SeenLast Seen
Server TrafficServer Traffic
  • Total: 373,157,424
  • Today: 69,775
Server InfoServer Info
  • Dec 12, 2018
  • 03:03 pm CET