SO-53681319

by David Thomas

HTML

<a href="https://companysachinperf.com/newweb/TicketDetnumber.jspx?tNumber=7-12345" data-oldhref=""></a>

CSS

a::before {
  content: attr(href);
}

a::after {
  display: block;
  content: '\A(Used to be: ' attr(data-oldhref) ')';
}

JavaScript

(() => {
  let links = Array.from(document.querySelectorAll('a')),
    newPath = '/xyz/Ticketnumber.jspx';
  links.filter(
    (anchor) => {
      if (anchor.hostname === 'companysachinperf.com') {
        anchor.dataset.oldhref = anchor.href;
        anchor.hostname = 'oldwebe.company.com';
        anchor.pathname = newPath;
      }
    })
})();