Preserve destination with Rules' "page redirect" action

I often us the Rules module to redirect a user to the login page when they try to access protect content. Unfortunately, Rules' "page redirect" action doesn't preserve the destination parament, i.e., the node that the user was trying to view. Adding a small bit of php code to the redirect url fixes this issue:

To: user/login ? <?php destination=node/[node:nid] ?>

I didn't understand where you add the php code... could you point to the path or code?


Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.