I have created a WordPress site and I've created a 'portal' page that is the main page that is displayed when you visit https://domain.tld
. I have a plugin that forces any users that are not logged in to only be able to view this portal page. If they are logged in they are able to navigate throughout the site.
On the portal page there is a link to the home page that shows the rest of the content/navigation menu of the website. I want users that are not logged in to be able to click the link to the home page and be asked to login rather than be forced to only be able to access the portal page. I can change the link on the portal page that is pointing to the home page to point to https://domain.tld/wp-admin
instead but then any user that is already logged in will be brought to their admin panel instead of the home page.
What can I do to rectify this? I am thinking about moving the WordPress installation to https://domain.tld/wp/
instead and have a static non-WordPress page on the root and force the users to login once they hit WordPress. Is there a way I can redirect logged in users away from the /wp-admin/
if they are logged in if they click the home page link?