The Joomla! Community Portal ™

Thu

12

Nov

2009

A Preview of Link Redirection in Joomla 1.6
Written by Andrew Eddie   
Thursday, 12 November 2009 06:44

Joomla 1.6 will include a new component and plugin called Redirect.  Its main function is to provide a mechanism to record 404 "not found" errors, and to give the Web site owner the ability to redirect those to another page if desired.

The Redirect component and plugin is very important in Joomla 1.6 because, at the very least, the new category system will create some new URL's.  Some Joomla 1.5-style URL's will no longer be applicable in Joomla 1.6.  However, Joomla 1.6's new capabilities may also lead you to experiment with new site structure that was not achievable in Joomla 1.5.  Whatever the case, Redirect has been provided to give you the best chance of preserving your search engine page rank (amongst other things).

In the Joomla Administrator some of you may have noticed the Redirect component in the alpha versions that have been released.  Its partner in crime is the System Redirect plugin.  This is currently turned off by default (because Redirect can collect a lot of information over time).  To enable the Redirect plugin, select Extensions -> Plugin Manager from the Administrator menubar, then filter on the "system" type.  Enable the plugin in the normal way.

Screenshot

Now you are ready to start trying to break your Joomla site.  Go to the frontend of the site and put in some incorrect URL's, or find a real article in the sample number and then deliberately put in the wrong article ID.  Your aim is to generate a typical Joomla red-screen-of-death like in the following screenshot.

Screenshot

Since the Redirect System Plugin is enabled, it will record the fact that this page threw a 404 not found error and will await your orders on how to handle it.  Return to the Administrator and select Components -> Redirect from the menubar.  Your page should be similar to the following screenshot, with a list of links collected from the error pages.

Screenshot

You can see what the URL was that threw the error and the time that it was created.  You'll also see the New URL is blank.  We can quickly fix up a redirect on several pages by using the quick update form at the bottom of the page (not, you won't see that form if you don't have any error pages collected).  As shown in the following screenshot, we've selected some of the error pages and entered the new destination page as well as an informative comment about what we are doing.

Screenshot

When you click the "Update Links" button, the list will return as shown in the following screenshot.

Screenshot

You can see the New URL fields are now populated and that the links are enabled.  If you try those pages on the frontend again, you should be redirected to the new URL that you entered.

Of course, you don't have to wait until people have hit stale links before you can put them into the system.  Click "Add" in the toolbar and you will be able to add in a redirection manually as shown in the following screenshot.

Screenshot

Save the link and you are away (to another page as it were).

This is a really neat inclusion for Joomla and one that I think will be enjoyed by most site administrators.

If you'd like to discuss this new feature, please join in the Joomla Alpha 2 discussion on the forum.  If you are wanting to see this feature in action (and are feeling a little bit lucky), you can download and test the nightly build of Joomla 1.6 (allow a day or so for recent work and bug fixes to come through).

Please keep in mind that we are still in an Alpha stage and many things are either broken or not working as planned - but we are getting there.


Andrew Eddie is a co-founder of the Joomla Open Source project and is highly active in the version 1.6 development process.  He currently operates a Joomla-based development and training consultancy New Life in IT, blogs regularly at the Art of Joomla and produces high-quality commercial Joomla extensions through his company JXtended.