JSFiddle - React, Tailwind, and code Playground

by charlescarver

HTML

<a href="http://rapidgator.net/file/xxxx">http://rapidgator.net/file/xxxx</a>
<a href="http://www.mysite.com?ref=http://rapidgator.net/file/xxxx">http://rapidgator.net/file/xxxx</a>
<a href="http://rapidgator.net/file/xxxx">http://rapidgator.net/file/xxxx</a>

JavaScript

$('a[href*="http://"]:not([href*="http://www.mysite.com"])').each(function(){
    var current = $(this).attr("href");
    $(this).attr("href", "http://myspecificdomain.com?ref=" + current);
});