Now i know there are some ways that a redirect on login can be setup, ie using views etc, but i think my issue maybe a bit more complicated.

When a user accesses a node for example where they are prompted to login, from here they are directed over to the /user/login page.

I want the user to be redirected back to the page they were before they came to the /user/login page, with a few exceptions of course.

How can i get the user journey to be...Node -> user/login -> redirect back to Node?

3 Answers 3


One of the ways to do this (if you are able to build the links manually) is to add the destination parameter to the URL.


After login, you will automatically be redirected to node/xxxx.

  • I think you are along the right lines here, the only problem is my /user/login pages are setup using FPP and so cannot use a token for each referring node.
    – Key
    Apr 8, 2015 at 15:05

Here's another way with Rules:

Event - Drupal initialize

Condition - site current user does not have a role authenticated Condition - site current page url does not contain 'user/'

Action - Site-redirect to user/login, append original destination.

Not the most efficient of ways, but no coding is required.

  • Tried setting this up but have realised this is not what i am after, this forces anonymous using to the login page.
    – Key
    Apr 8, 2015 at 15:05

There is a module that takes care of this called Login Destination.

The Login Destination module allows you to customize the destination that a user is redirected to after logging in, registering to the site (7.x), using a one-time login link or logging out (7.x). The destination can be an internal page or an external URL. It is possible to specify certain conditions like referring pages or user roles and make the destination depend upon them. You may use PHP snippets to provide custom conditions and destinations. It is also possible to keep users on the currently visited page after logging in or out.

Also available for Drupal 8Login Destination (D8)

  • Have tried this module but doesn't seem like it works to what i need it for
    – Key
    Apr 8, 2015 at 15:03
  • @Key I'm not sure how you are redirecting users to the login page in the first place, but you can probably replace that process with r4032login which will take care of both redirects. Apr 8, 2015 at 15:51

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.