How to redirect from subdomain login page to main domain login page across multisite and shared user environment?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
sid3000's picture

Hi,
I have one main site (mydomain.com) and one members subsite (members.mydomain.com). In this case members.mydomain.com is master site but cookie domain in settings.php of master site (members.mydomain.com) is mydomain.com. And that works perfectly.

But I want user can signup/login through members.mydomain.com/user page, that mean if any user can click on mydomain.com/user link, it will be redirected into members.mydomain.com/user page with destination link.

Any idea, help or guidance appreciated.
Thanks.
sid.

Comments

you can try adding this code

Ainur's picture

you can try adding this code to your template.php file

<?php
global $user;
if (!
$user->name) {
 
drupal_goto('where redirect to' . $_GET['q']);
}
?>

Thanks for your good reply

sid3000's picture

Thanks for your good reply

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week