I want to redirect users to their profile (/user) after they save changes to their profile settings (/user/[uid]/edit).

If their accounts are updated in another manner (by rules, etc.), I do not want them to be redirected.

I made a rule like this:

  • Event-> After updating an existing account
  • Actions-> Page redirect to user/[account:uid]

This redirects properly; however, on my site sometimes user accounts get updated when a user adds content. Adding content then also causes this rule to get called, which I don't want. I only want the user to be redirected if they updated their account details at user/[account:uid]/edit.

I tried adding:

  • Condition: Path has URL alias: user/[account:uid]/edit

However, then the redirect ceases to function.

1 Answer 1

{ "rules_cw_profile_redirect_user_to_profile_page_after_edit" : {
      "LABEL" : "Redirect user to profile page after editing account",
      "PLUGIN" : "reaction rule",
      "REQUIRES" : [ "rules" ],
      "ON" : [ "user_update" ],
      "IF" : [
        { "data_is" : { "data" : [ "site:current-page:url" ], "value" : [ "account:edit-url" ] } }
      "DO" : [ { "redirect" : { "url" : "user" } } ]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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