I think this is what you're looking for.
Some javascript:
$(document).ready(function(){
var a = Array('http://www.example.com');
if(window.location.host == "fiddle.jshell.net"){
$('a').each(function(){
if(a[$(this).attr('id')]){
$(this).attr('href',a[$(this).attr('id')]);
}
});
}
});
Some small html:
<a href="http://www.yourdomain.com" id="0">Example</a>
You can check it here
What I did is checking if the domain is your domain. In this example I had to use the location host of the iframe of jsfiddle. If a competitor copies the html then all links goes to your domain.
Is this what youre looking for?