Hide source of traffic when link clicked Wordpress

Dimension

Newbie
Joined
Jul 11, 2009
Messages
11
Reaction score
0
Hi there, I'm having an issue where I have lots of links on my Wordpress site which links to an external URL(each link is different). I don't want the owner of the external URL to see that the traffic is coming from my site. If possible I would like the following to happen.

1 User clicks link to external URL on my Wordpress site.

2 Link to external site is captured and transferred to my other hosted domain name (don't care if other site owner sees traffic is coming from here.)

3 User is directed to the clicked link through my other hosted domain, external site owner sees traffic from the other hosted domain, and not my first site.

I'm not sure how to do this, I did think I could just make the link something like https://myseconddomain.com/incoming/&https://siteownersurl.com Then use PHP to get the siteownersurl and do a redirect. The problem is in Wordpress this link is not valid and does not go to my second url, it just opens the origin page I'm on in a new tab. https://myseconddomain.com/incoming/&https://siteownersurl.com but when I put it in the browser and check webdeveloper tools network I see it works. Any help would be excellent, thanks.
 
You need to set 2 redirects:

- Redirect 1: from visited website to your second hosted site.

- Redirect 2: from second (hosted) website to the target (external) site.

You can do this with a redirect (either via a plugin or directly from .htaccess).
 
Thanks for help, I decided to use PHP for the two redirects. On my first site (wordpress) I make the link look like firstsitedotcom/incoming.php/&l=linkid I get the link IDs I want using python and selenium chrome driver and automatically insert the links into my wordpress pages.


The code on incoming.php on my first site (wordpress) is as follows. This also prevents the users seeing where the link will take them when they hover over it.

Code:
<?php

if( $_GET["l"] ) {
    $newUrl =  "secondsitedotcom/incoming.php&l=". $_GET['l'];
    header('Location: '.$newURL);
    exit();
 }

?>

Then I use the following on incoming.php on the second site, that I don't care about the site I'm linking to seeing as the referrer.

Code:
<?php

if( $_GET["l"] ) {
    $newUrl =  "siteilinktodotcom/postid.php&l=". $_GET['l'];
    header('Location: '.$newURL);
    exit();
 }

?>

So now they can't tell my first site is linking to them. Also, the second site is not hosted on the same IP so no reverse lookup to find my first domain.
 
Back
Top