In this tutorial we will use the Trigger
core module to configure a simple page redirection after a user has logged in. You may also use Rules
module described here http://drupal.org/node/939876.
Requirements
- Drupal 6.x
- Trigger core module under
admin/build/modules
Optional
- Token contributed module if you want to use tokenized URL. Make sure that the Token sub-module
Token actions
is activated.
Steps
-
We are now going to create an action. To do so go to Actions settings page under
admin/settings/actions
- Going to
Make a new advanced action available
. - Choose
Redirect to URL...
. Click onCreate
button.
Note that if you want to use a tokenized URL then chooseRedirect to a tokenized URL...
- A new window opens
Configure an advanced action
- Description: Redirect to particular page
- URL:<front>
More
URL:
examples<front>
will redirect user to your site default front page. As defined underadmin/settings/site-information
.user/[user-id]/track
will redirect user to user'sTrack
page. To read more about tokenized actions expend thePlaceholder tokens
section located at the bottom ofConfigure an advanced action
page.
Note that you must install Token contributed module if you want to use tokenized URL. Plus you must activate the Token sub-module
Token actions
. - Click on
Submit
button. You have successfully created an action.
- Going to
-
We are now going to create a trigger. To do so go to
admin/build/trigger
- Click on
Users
tab. - Choose
Trigger: After a user has logged in
. - Choose an action
Redirect to particular page
- Click on
Assign
button.
- Click on
That's all. To test log-out and log-in. You'll be redirected.
Important Note!
If it doesn't work then check if you have another redirection. A Views can redirect to any page. I suggest you try this tutorial on a clean install of Drupal, so you will have better understanding how Drupal's Trigger works.
Comments
Not working...
Hello,
When I login into drupal site,I want to redirect the site to a particular URL.I am following these steps of triggers and actions,but its not working.Its redirecting me to the home page.So what can be the problem?any idea?
Thanks,
Swati
Make sure that you don't use
Make sure that you don't use logintoboggan.module.
If you are using pathauto, use that tokenized path.
i.e . When the user - 1 log in, redirect should be,
/user/%uid
try it once,
else, help available at
ayeshlakmal+drupalforum@gmail.com
What's new and changing in PHP 8
I can redirect on node actions, but not user actions
On log in, I wanted the user to be redirected to his profile page. I have set up the following redirect destinations:
Both of the above destinations map to the same user's profile page (I am using advanced profile kit, so the user's profile is a node). I have successfully bound these redirect actions to any node trigger (for example, on new content creation, or on updating content). However when I've tried binding them to the user-log-in trigger, they don't work.
In an attempt to try to get any action bound to the user-log-in trigger, I also tried binding the action which resets the user's number of posts to zero. This also did not work.
The same for me
I've tried the same thing : the redirection is functionnal when associated with new content creation trigger but not with user login trigger...
(excuse me for my english... i'm french...)
same
Same for me...
I'm really getting at this point that I'm want to gave up on drupal :s
I get a lot of errors and trying to design one job website it is a gigantic task with no light in the end of the tunnel.
D7 still not working
I trying to redirect on user login in D7 and it still goes to the site home page.
Works fine
This mean works fine :) because by default after loggged in then you will redirect to User Account page. Check again your "Redirect URL" entry. This tutorial use
<front>
for example, change to your desired URL.This seems to only work when
This seems to only work when a user logins in from the /user page, not from a login block placed in the sidebar or somewhere else on your site.
Ditto
Confirming that it does not work from the login block.
Force redirecting
If not working then edit your action and check the option
Force redirecting to the given path, even if a destination parameter is given
i don't have it
Sorry, but in the action settings or trigger - i don't have "Force redirecting to the given path, even if a destination parameter is given"
What i gotta do? Help me! Thanks =)
admin/rules/trigger
"Force redirecting to the given path, even if a destination parameter is given" is from the rules module... http://drupal.org/project/rules
Tested and work on Drupal 6
I just fixed this tutorial, make it more simple and remove Rules module parts.
Tested and work on Drupal 6.