Sure you can do this in Drupal using the Rules module ...
Here is an example of such rule for Drupal version 7, in what is called Rules "export format":
{ "rules_redirect_selected_roles_to_selected_term_pages" : {
"LABEL" : "Redirect selected roles to selected term pages",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "user_login" : [] },
"IF" : [
{ "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "5" : "5" } } } }
],
"DO" : [ { "redirect" : { "url" : "node\/123" } } ]
}
}
You should be able to just "import" the above rule in your own Drupal installation via Drupal's Admin UI, using the link labeled "import rule" which is located at relative path admin/config/workflow/rules/reaction/import
in your own Drupal site.
Some more details about what the above rule actually does:
- It is triggered by the Rules Event =
User has logged in
.
- It includes a Rules Condition which in this case is
User has role(s) = subscriber
. Actually the 4
in the export format above corresponds to subscriber
in the Drupal installation where I exported this from, if you would change, before importing, that 4
to a 3
, it would correspond to administrator
instead (just pick whatever "role" you'd want, by changing it using the Rules UI, after you imported this rule). If you'd want this to apply for any role, then just omit (delete) this Rules condition (the easiest way to perform such delete, is using the Rules UI after you imported this example).
- It will perform a Rules Action =
Page redirect = node/123
. This node/123
is what is desired in the Drupal installation where I exported this from, but you can simply change that to any valid (relative) path that you want. So make sure to change that node/123
to the relative path of the page corresponding to your "... page other than the User Profile on login ...".
That's it, works like a charm!
You could make it even (way) more sophisticated by enhancing the rule with options like:
- Redirect to a page (path) that depends of the role of the users.
- Make the redirect depend on the day(s) of the week, or the time of the day (eg during open/close hours of a shop).
PS: if you're interested in (way) more examples of amazing things you can do with the Rules module, then visit these answers on Drupal.SE (to questions tagged with the Rules module).