3

I am using Drupal 7. It is good that when user is logged out and again he access the

user/logout 

link he is redirected to Access denied page.

Now I want that instead of Access denied page, i want to redirect to the specific page.

Can i achieve it using rules module or i have to write the code for that

  • rules module will do – subhojit777 Jan 29 '13 at 5:31
-2

In Site Configuration > System > Site information you can specify the Access denied path.

Simply give the path to your front page and you will be redirected to front page of the site.

|improve this answer|||||
  • 4
    Why is this even an answer? You effectively take away your access denied page... You can use rules and use the event on user logout. Way better option IMO. – iLLin Sep 9 '13 at 13:32
1

What you want is something called 403 redirect to Login: https://drupal.org/project/r4032login

403 access denied messages will get redirected to the login page. I've used this before and it works nicely.

|improve this answer|||||
  • 1
    r4032login doesn't deal with logout – Druvision Jan 6 '14 at 20:23
  • Not sure what Druvision is talking about-- this worked great! Thanks! – WebMW Feb 28 '18 at 7:08
1

Use Rule Module Event Operations: User has logged out

Actions Elements Click add action Select the action to add "page redirect"

Here in url specify path where you want user after logout.e.g if you want to redirect to your site front page enter. http://www.example.com Note:replace example with your site name.

|improve this answer|||||
0

For redirect choose "Page Redirect" in "System" options group

|improve this answer|||||
0

If you are generating this logout link use the following to generate it and redirect the user.

l(t('Logout'), 'user/logout',array('query' => array('destination' => 'node/any')));
|improve this answer|||||
0

The redirect_after_logout module deals with it.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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