Since 2009, Stack Exchange has been rewriting links to products being sold on Amazon.com (only the U.S. site, not other international Amazon sites) to add in its own affiliate referral code to the link, so that if someone follows a link someone put in a post, and goes on to purchase the item in question, Stack Exchange earns a commission of the purchase.
Basically, whenever the Markdown renderer sees an Amazon link, it will rewrite that link in the rendered HTML to instead go to
rads.stackoverflow.com, which is a redirect domain which, for many years, has redirected the user back to the Amazon site, but with Stack Exchange's affiliate referral code in the URL.
While it is intended to be transparent (a normal user who doesn't check any URLs would just be directed to the relevant item and make their purchase without knowing about the redirecting that has happened), in some cases, bugs in the rewriter or the redirect domain can result in links unexpectedly breaking when pasted into Stack Exchange posts or comments. For instance, there's an ongoing bug where links to promotions or item listings (and not specific items) are being incorrectly rewritten and becoming broken. There was also a (now fixed) bug where links to the aforementioned international Amazon sites were being incorrectly rewritten into links to the U.S. site. Finally, as the link rewriter is essentially dependent on Amazon links being formatted a certain way, if Amazon decides to change the format of newer links, it can result in tons more broken links until it's fixed (and posts are rebaked).
As all these bugs require resources to fix (the aforementioned fixed one wasn't fixed until an Amazon employee responded to the bug report), I began to wonder if the affiliate referral fees were enough to offset the costs of maintaining the program, and the response at the time was that the net gain was high enough (far higher than the responding employee's salary every month).
However, as of October 4, 2019, Stack Exchange stopped inserting its affiliate code into the redirects generated from
rads.stackoverflow.com: if you follow an Amazon link from Stack Exchange today, it will still have been rewritten to go through that URL, but the redirect that that domain spits out no longer has an affiliate code, so Stack Exchange no longer makes a commission on them. It therefore doesn't have a real purpose anymore.
So, given that the link rewriter essentially has no purpose, and Stack Exchange needs to spend time and resources fixing not only the ongoing bug but also any future bugs that come up (making it a net negative), can we get rid of it?
Mark commented about one potential use of link rewriting: that if someone attempts to put an Amazon link with their own (or any different) affiliate referral code, that will be stripped out. However, I don't think spending resources to maintain this whole redirect mechanism is worth this one advantage. While it is true that putting in your own affiliate link is considered spam, we don't get as many users doing this with Amazon links (in particular, Amazon doesn't simply allow people to just sign up for the program; one has to have a business or organization in order to do so). Additionally, for the rare case where it does occur, we have community tools such as SmokeDetector that can check for and report affiliate links.