Remove language slug to a path in a cloaking url
I have created a cloaking url, but I have a problem, I am using a translation plugin called translatepress. When I change the language the cloacking url changes from mysite.com/refer to mysite.com/es/refer or whatever secondary language I select. To create the cloaking url I use this tutorial: https://yoast.com/cloak-affiliate-links/ everything goes in the same folder that is created for the cloaking url. I already tried a filter that the plugin gave me, but it doesn’t work, so I would like to know:
Can it be done somehow by modifying the .htaccess or the index.php?
Is there a filter that somehow isolates the path and is not affected by translation plugins?