There’s a filter in place specifically for tag links, can be found in source here.
http://core.trac.wordpress.org/browser/tags/3.0.4/wp-includes/category-template.php#L780
It’s the first function you see on the above link, and it’s this line that provides a hookable filter.
return apply_filters( 'tag_link', $taglink, $tag_id );
Here’s an example of hooking a function to that hook..
add_filter( 'tag_link', 'new_tag_link', 100 );
function new_tag_link( $taglink ) {
// What to find in the link
$find = home_url();
// What to replace it with
$replace_with="http://example.com";
// Run string replacement
$taglink = str_replace( $find, $replace_with, $taglink );
// Return the modified tag link
return $taglink;
}
I have not tested the code because as indicated above it’s only an example, but in theory the above should do exactly what you asked.
Hope that helps.
UPDATE: Code provided above works just fine now, you can also use the below code as an alternative, both will effectively do exactly the same though.
add_filter( 'term_links-post_tag', 'replace_tag_domain', 100 );
function replace_tag_domain( $links ) {
// What to find in the link
$find = home_url();
// What to replace it with
$replace_with="http://example.com";
foreach( $links as $k => $link )
// Run string replacement
$links[$k] = str_replace( $find, $replace_with, $link );
// Return the modified tag link
return $links;
}
NOTE: Code can go into the functions file of your theme, that’s where i do my testing.