Redirect to homepage after logout

Jordan: 2 weeks ago

I want to redirect a user to the homepage of my joomla website and that he must not be able to go back in the browser.absolutely not.

I tried many things in regards to this but couldn't accomplish it.

How do i stop going back and redirect the user to the homepage.

P.S i have a login module that has a parameter logout redirect page : have set it to the homepage menu that appears in the checkbox.

doesn't work.

Isla: 2 weeks ago

It seems that you want non-logged in users to access only homepage of your site.

Obviously if you redirect them on logout then user can always go back to any other url.

What i suggest, you should create a system plugin for this which will check whether user is logged in or not. And if user is not logged in then redirect him to the homepage.

You can apply this checking on joomla event onAfterRoute()

function onAfterRoute()
  $userId = JFactory::getUser()->id;

  //if user is not logged-in redirect to home-page


For joomla plugin creation you can refer these tutorials

Plugin Development (

Creating Plugin for Joomla (