How to route short tag to external web site I am writing a plugin to that will map http://short.com/e9DG to http:/longdomainname.com/longsubpagename

I assume I need to use the config/routes.php but am having struggling to understand how how to set this up. I keep getting 404 as it cannot resolve the url.

As a test I have the foloing code

return array(
    'e9DG' =&gt; array('action' =&gt; '/cocktailrecipes/ingredients/new'),
);
With the registerSiteRoutes hook you can route http://short.com/e9DG requests to any template.

public function registerSiteRoutes()
{
    return array(
        'e9DG' =&gt; '/mysection/mytemplate.html',
    );
}


With getUrl and redirect accessible via craft()-&gt;request you can set up server redirects:

$url = craft()-&gt;request-&gt;getUrl();

if ($url == 'http://short.com/e9DG')
{
    craft()-&gt;request-&gt;redirect('http:/longdomainname.com/longsubpagename', true, 301);
}