How to redirect user when the user is logged in?
-
User visits homepage, it loads custom PHP script at
http://www.domain.com/index.php -
Index.php script – Verifies user is logged in with
Get http://panel.domain.com/CheckUserLogin.aspxCheckUserLogin.aspxresponse with text “True” when the current user is logged in, otherwise “False” -
If True redirect to
https://panel.domain.comelse redirect tohttp://www.domain.com/cms
Instead of using PHP, you could do this on the client-side with JavaScript. Using jQuery, something like this: