I want to redirect a user after successful registration maindomain.com to open his site in a new tab.

His site url will look like this newuser.maindomain.com. (username.maindomain)

Any Suggestions?

  • How are you setting up/creating the subdomains? – Patrick Kenny Aug 7 '13 at 6:54
  • @PatrickKenny: i am using domain rules module to create sub domains. using rules i create new domains, when user registers i am creating like user-name.domain.com. – Ram Aug 7 '13 at 6:57

Use Rules again to do the redirect.

On Event Drupal is initializing or User has logged in add a condition if you need that (eg check that user role is not anoymous) and then add an Action of Redirect. In there use some php for the redirect path using the global variable $user (you may need some formation also if the username has spaces).

Notice that you must run this Rule after the rule that creates the subdomain. Or you can simply add the redirect action on the same domain_rules rule after the component that creates the subdomain.

You must also have a common user database along sites (domain and subdomain). The Bakery module is a good option here.

| improve this answer | |

i feel you have to use SSO for authentication among multiple domains, check this bakery module!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.