I have two domains mapped in a single installation.
The main problem is if I access the website with the second domain, the user won’t be logged in the website. That’s a fact, I can’t do it due to security problem.

So I was thinking of redirecting the user to the main domain if he is logged. But the problem is still the same. I can’t detect if he is logged in the main domain because we access by the second domain.

By accessing the website by the second domain, is there a way to detect if he is logged in the first domain ?

This is what I have to detect if user is logged in in my wordpress :

RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$

So basically :
if access website by domain2.com, check if logged in domain1.com.
domain2.com is mapped to domain1.com

Read more here: Check if logged in main domain in single wordpress installation


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: