How to generally redirect to log-in on restricted pages?

Our site has a bunch of pages that are log-in restricted, and currently there’s a log-in module on the /home page. This means that if users are directly linked to a restricted page while not logged in, they get directed to a 401 error page instead of the log-in page. It seems like one possible solution here is to copy the log-in module from the /home page to all pages that are restricted, but that seems open to developer error and things getting easily out of sync.

Is there a way to redirect to log-in on all of the restricted pages by default, instead of having to copy the log-in module to each restricted page?

Hello,

Pls, check the following article on how to setup a 401 page and add login.

Thanks!

1 Like