Modify url in inline link

Using Rhythmyx 6.50 we have an inline link to a document content type in an Ephox control using the rffBinary template.
Is it possible to change the url used in the href when publishing the link so that it goes to another page (a web analytics page) and pass the original url of the content item so that it can be redirected after being logged.

e.g. Existing:

<a href="http://site.com/doc1.pdf">

needs to be

<a href="http://analyticssite.com/sitename?params&url=http://site.com/doc1.pdf">

Added a new location scheme to the ‘Site Folder Assembly’ context to output the modified URL. Also had to change the sys_assembly_context in the URL property of the content lists to use the ‘Site Folder Assembly’ context rather than the Publish context.