= Redirection for Trac = [[TracNav]] == Purpose and Usage == The ![[redirect(type:id)]] wiki macro provides redirect functionality for Trac with backlink support. It takes a qualified [wiki:TracLinks TracLink] as argument, e.g. `wiki:SandBox`, `source:README` or `ticket:123`. Users with a JavaScript-enabled browser will get redirected to the page specified by this shortlink. == Download and Installation == === For Trac 0.11 === [[Image(new.png)]] This version of the plugin works with Trac 0.11. It is available here (version 0.11.2, release 08/14/08): * Source: [source:/trac/plugins/redirect-0.11 Trac browser], [//repos/javaparty/JP/trac/plugins/redirect-0.11 anonymous SVN], [attachment:TracRedirect-0.11.2.zip?format=raw ZIP archive] * Binary: [attachment:TracRedirect-0.11.2-py2.5.egg?format=raw Python 2.5 egg] Note: This version will not work with Trac 0.10! === For Trac 0.10 === The TracRedirect macro has been converted into a plugin. Thanks to Michel Jouvin for doing the initial conversion! The installation is very easy: Simply drop [attachment:Redirect-0.9.1-py2.4.egg?format=raw this Python egg] into the plugin subdir of your project. Note: This requires Trac >= 0.9 and setuptools >= 0.6! The pre-packaged egg is for Python 2.4. The source code is available, so you can build your own egg: * as a ZIP archive: [attachment:Redirect-0.9.1.zip?format=raw Redirect-0.9.1.zip] * browsable: [source:/trac/plugins/redirect] * via [//repos/javaparty/JP/trac/plugins/redirect anonymous SVN] To enable the plugin, add this setting to your trac.ini file: {{{ [components] redirect.* = enabled }}} For more information about Trac plugins, see http://projects.edgewall.com/trac/wiki/TracPlugins. === For Trac 0.9 === Download the `redirect.py` macro [source:trac/trunk/wiki-macros/redirect.py here] and put it either in the global `wiki-macros` directory of your Trac installation (typically `/usr/share/trac/wiki-macros`) or into the `wiki-macros` subdirectory of your project. Then add these lines to the `templates/site_header.cs` file within your project: {{{ ' + args.redirectedfrom + '' + ' (hide)' ?> }}} === For Trac 0.8 === You can download the latest version for Trac 0.8.x [source:trac/trunk/wiki-macros/redirect.py@3026 here]. Put the `redirect.py` file in the global `wiki-macros` directory of your Trac installation (typically `/usr/share/trac/wiki-macros`). Additionally, you need the following two patches in order to display a link on the target page of the redirection back to the alias page (e.g for editing the alias). When following the backlink, redirection is disabled. {{{ #!diff Index: templates/wiki.cs =================================================================== --- templates/wiki.cs (Revision 2983) +++ templates/wiki.cs (Revision 2986) @@ -5,6 +5,15 @@