Skip to main content

Drupal redirect after logout

An article from ComputerMinds - Building with Drupal in the UK since 2005
6th Dec 2007

Mike Dixon

Senior Mind
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?

A quick one that came up today, we all know about the login redirect module, which automatically redirects the user to a specific page when they login ... but what about at logout?

Its a common scenario, you want to display a nice 'come back soon' message when one of your lovely users does the unthinkable and logs out. One solution would be to create a new module, implement hook_user and then invoke a drupal_goto when the $op=='logout'.

A simpler solution is just to add the query string ?destination=my-path (where my-path is the drupal path of your post logout page) to your logout link.

Hi, thanks for reading

ComputerMinds are the UK’s Drupal specialists with offices in Bristol and Coventry. We offer a range of Drupal services including Consultancy, Development, Training and Support. Whatever your Drupal problem, we can help.