I would like to make a site that is just for users who know a generic login (guest) and password.

When anyone else accesses the domain name I don't want them to see the home page, just a requirement to log in.

When a user uses the correct login, I want them to go straight to the home page, not the user details page.

At the moment I have set permissions so that nothing is checked for anonymous users but currently they still get shown the home page header, most of the primary navigation, and the hero block. I want to hide these and just go directly to the log in page, then if successful in logging in go directly to the home page.

Is this something that can be done with some settings or is a contributed module required?



Interesting. You can do this pretty easy. 

Just create two layouts with the path of "home." 

Layout #1

  • Delete all blocks except the "user menu"
  • Path is "home"
  • Visibility condition: User has the role Anonymous

Layout #2

  • Normal home page layout for authenticated users
  • Path is "home"
  • Visibility condition: User has the role Authenticated

Then create a URL Redirect from user/* to home.


That should accomplish your goal.

I have also been recommended to try the contributed module Shield and this does just what I need.