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

1
  • rules module will do Commented Jan 29, 2013 at 5:31

6 Answers 6

-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.

1
  • 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
    Commented Sep 9, 2013 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.

2
  • 1
    r4032login doesn't deal with logout
    – Druvision
    Commented Jan 6, 2014 at 20:23
  • Not sure what Druvision is talking about-- this worked great! Thanks!
    – WebMW
    Commented Feb 28, 2018 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.

0

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

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')));
0

The redirect_after_logout module deals with it.

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.