[[PageOutline(2-5,Contents,pullout)]]
= Plugin for Rewriting External Link URLs
== Description
Rewrite external link location, to hide referers for private sites, to use social bookmark sites, and so on.
For example, Trac link:
{{{
[http://foo.bar.com outgoing site]
}}}
becomes in html:
{{{
outgoing site
}}}
But, !ExtLinkRewriter converts it as:
{{{
outgoing site
}}}
Jumping outgoing site via single redirector, referrers with detailed page names could be hidden. It is useful for private or restricted sites, for example project sites in local networks. This plugin contains simple redirectors.
Or, using bookmark site del.icio.us:
{{{
outgoing site
}}}
=== Redirector
1. Copy redirector/rediretor.html at accessible point.
{{{#!sh
$ cp redirector/rediretor.html /var/www/
}}}
Check redirect function at your browser, for example go to `http://.../redirector.html?http://google.com`.
2. Edit your `conf/trac.ini` file:
Example options:
{{{#!ini
[extlinkrewriter]
format = /redrector.html?%s
namespaces = http,https,ftp
target = _blank
}}}
Notice the underscore before `blank`.
=== Social Media Bookmark
del.icio.us:
{{{#!ini
[extlinkrewriter]
format = http://del.icio.us/url?url=%s
namespaces = http,https
}}}
Hatena bookmark:
{{{#!ini
[extlinkrewriter]
format = http://b.hatena.ne.jp/entry/%s
namespaces = http,https
}}}
=== Mix redirector and bookmark
{{{#!ini
[extlinkrewriter]
format = /redirector.html?http://del.icio.us/url?url=%s
namespaces = http,https,ftp
target = _blank
}}}
== Bugs/Feature Requests
Existing bugs and feature requests for ExtLinkRewriterPlugin are
[report:9?COMPONENT=ExtLinkRewriterPlugin here].
If you have any issues, create a
[/newticket?component=ExtLinkRewriterPlugin new ticket].
[[TicketQuery(component=ExtLinkRewriterPlugin&group=type,format=progress)]]
== Download
Download the zipped source from [export:extlinkrewriterplugin here].
== Source
You can check out ExtLinkRewriterPlugin from [/svn/extlinkrewriterplugin here] using Subversion, or [source:extlinkrewriterplugin browse the source] with Trac.
== Installation
Make the egg package:
{{{#!sh
python setup.py bdist_egg
}}}
Copy egg into your Trac plugins directory:
{{{#!sh
cp dist/ExtLinkRewriter*.egg /where/to/trac/plugins/
}}}
To activate the plugin, edit your `conf/trac.ini` file:
{{{#!ini
[components]
ExtLinkRewriter.* = enabled
}}}
== Recent Changes
[[ChangeLog(extlinkrewriterplugin, 3)]]
== Author/Contributors
'''Author:''' [wiki:bellbind] [[BR]]
'''Maintainer:''' [[Maintainer]] [[BR]]
'''Contributors:'''