Thank you for getting in touch.
At first I was struggling to imagine what could be going wrong, but then realized that I probably need to just make it clear how (and when) the redirect feature is supposed to work…!
If you login to WordPress directly by typing in the URL (e.g.) https://intranet.mycompany.com/wp-login.php, then (hopefully) you should find the login redirect works as you hoped.
However, the redirect will be overridden if the login page only appears because a user tried to access a different intranet page (and needs to login to be allowed access).
For example, if a logged-out user attempts to access https://intranet.mycompany.com/specialpage/ you will see they are sent to login via this URL:
https://intranet.mycompany.com/wp-login.php?redirect_to=https://intranet.mycompany.com/specialpage/ (in reality the last part would be encoded slightly). The redirect_to component will override the Login Redirect of the plugin, and send the user to /specialpage/
So I’m guessing you are trying to login by accessing the URL https://intranet.mycompany.com/ (for example), and then being redirected via the login page, back to https://intranet.mycompany.com/ which overrides the login redirect because you were trying to access a specific page.
In summary, the login redirect only takes effect if a user logs in via https://intranet.mycompany.com/wp-login.php directly.
So your ‘standard link’ to your intranet, e.g. in the email you send out to employees, should be to the login page at https://intranet.mycompany.com/wp-login.php.
Obviously, this raises the question: why not just send out the URL of your intended redirect URL in the first place? That would work fine, but would be harder to change in the future.
Also, there is plenty of scope to increase the functionality of the plugin in the future. Perhaps we could find a way to redirect to different pages based on username or WordPress role?
Such enhancement suggestions would be gratefully received, and of course relies on feedback from users such as yourself. It would be great if you get a chance to describe in more detail what you are trying to achieve with your intranet, and why your login redirect page was chosen etc. Please email [email protected] if you have a moment to let me know.
I hope this explanation helps – sorry for the long description! I’ll try to find a way to make the behavior clearer in a future release.
Thanks,
Dan