How do you redirect users after a successful login? PDF Print Email

Select the redirection page from the list of menu links offered. Make sure that the link is to a published item.

Note: The same procedure is used for redirecting users on successful logout except you enter the page where you want to redirect successful logouts to where it says "Logout Redirection URL."

If you would like to override the default login specified in your Administration back end from your custom code you can do so with the following:

  • Take the url that you would like to redirect the user to after they have successfully logged in and apply the 'base64_encode' function to it. For example,
$redirectUrl = '''base64_encode'''($redirectUrl);  
// a base64_encode of index.php?option=com_pizzapie' yeilds: 'aW5kZXgucGhwP29wdGlvbj1jb21fcGl6emFwaWU='
  • Prepend the '&return=' query string to your newly encoded $redirectUrl. For example,
 $redirectUrl = ''''&return=''''.$redirectUrl;
  • Append that $redirecturl to the Joomla Login Url. For example,
              $joomlaLoginUrl = 'index.php?option=com_user&view=login';
$finalUrl = $joomlaLoginUrl . $redirecturl;

When you display that $finalUrl, it should look something like this: 'index.php?option=com_user&view=login&return=aW5kZXgucGhwP29wdGlvbj1jb21fcGl6emFwaWU='

The controller.php file in the com_user checks the contents of the 'return' in the JRequest object (the Joomla query access object). If it is set and in the base64 format, it base64_decode(s) it and applies that redirection.

 

New Joomla Templates

  1. Social ConnectedSocial ConnectedName: Social ConnectedDescription: Social Connected is a new professional, easy to use Joomla template released by the Joomladesigns team which includes custom CSS style layouts for the Jomsocial and K2 Extensions. The Social Connected template includes the following features Three Jooml ...Owner: JoomlaDesignsTags: Computers, Communications, Business, Architecture
  2. ExtendExtendName: ExtendDescription: Extend is a professional easy to use Joomla template released by the Joomladesigns Team. The new Extend template supports the following features Includes Four different Joomla Templates Built-in colour picker to customize the template colour scheme Bui ...Owner: JoomlaDesignsTags: Business, Beauty, Architecture
  3. NgineNgineName: NgineDescription: Ngine is a new professional Joomla template from Joomladesigns.co.uk which supports a wide range of features including Five built-in Joomla templates Slide show Slide pop up boxes K2 CSS styles RTL support Six built in font styles Lots of module posi ...Owner: JoomlaDesignsTags: Software, Portal, News, Games
  4. Simply City 2Simply City 2Name: Simply City 2Description: Simply City is a professional, fast loading Joomla template which is easy to use and includes a wide range of features. The web design also supports CSS styles for the popular K2 extension. The Joomla template includes the following features 3 multi col ...Owner: JoomlaDesignsTags: Computers, Communications, Business
  5. Simply CitySimply CityName: Simply CityDescription: Simply City is a professional, fast loading Joomla template which is easy to use and includes a wide range of features. The web design also supports CSS styles for the popular K2 extension. The Joomla template includes the following features 3 different ...Owner: JoomlaDesignsTags: Electronics, Computers, Communications, Business
  6. Show more...

Search Directory

Explore Directory

Top Joomla Design Teams