Joomla, custom redirection after sign in

When a user signs in in Joomla, he is automatically redirected at homepage.

This article explains you how to add a hack in Joomla 1.5, to redirect the user to the page of your choice after he signed in. It may be useful, especially if you want the user to do a specific action (e.g. : to post an article, a picture, subscribe to your services, etc.). From back-end, you may specify a Joomla! page for redirection, but no custom URL.

I used Joomla 1.5.8 for this example, but it should be the same pattern for every other J1.5.x version.

Open this file :

  1. [votre site]/components/com_user/controller.php

Look for this code line, that should be located at line 163, inside the login() function :

login() :

  1. $mainframe->redirect( $return );

All you have to do is to replace $return by the URL where you want users to be redirected. For instance :

  1. $mainframe->redirect( "http://www.guylabbe.ca" );

It's about

Comments

Thank you for this helpful

Thank you for this helpful post, I searched around and around for the solutetion and so happy to find your blog :)

i was happy to find this

i was happy to find this post...but this does not work when i tried it. I am trying to have user redirect to my custom page and not home page after they register.
Let me know if you have any suggestions.

Hi, Thanks for you interest!

Hi, Thanks for you interest! Just type the URL of your custom page instead of current (home) URL, but I guest you may have already tried this :) If it doesn't work, would you post here your code please so we can have a look at it

Thanks much for this nice

Thanks much for this nice piece of text.

in the login form module have

in the login form module have this option integrated.

Yes but you must choose a

Yes but you must choose a "Joomla!" page, you can't write a custom URL.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <actionscript>, <apache>, <bash>, <dos>, <html>, <javascript>, <mysql>, <php>, <xml>.
  • Every instance heading tags will be modified to include an id attribute for anchor linking.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Image links with 'rel="lightshow"' in the <a> tag will appear in a Lightbox slideshow when clicked on.
  • Links to HTML content with 'rel="lightframe"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to video content with 'rel="lightvideo"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to inline or modal content with 'rel="lightmodal"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to specified hosts will have a rel="nofollow" added to them.

  • Insert <!--tableofcontents [list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;]--> to insert a mediawiki style collapsible table of contents. Arguments within [] are optional.

More information about formatting options