Search code examples
php.htaccessonclickhttp-redirecturl-masking

duplicating click events happening on page to another page


i have a page say www.example.com. it consists of some results(like Google results, these results are injected by me by requesting a third party resource into example.com). on clicking one of them it will redirect to some url(say www.trackclicks.com/some.php) which tracks the referrer(on which the click event happening) in this case it is www.example.com

My requirement is i have to show www.trackclicks.com/some.php that click event happened on my page say mysite.com but not on www.example.com even though it happens on it(i have to mask it).

i never came across of this type of requirement, so i haven't tried anything. i used .htaccess to redirect the pages but not sure i can use them for diverting click events.

MY thought to do this:

i will create a page say cach.php on mysite.com and redirect the www.trackclicks.com/some.php from my site's page and click the www.trackclicks.com/some.php using javascript.

so the actual reult url on example.com will be like this

www.mysite.com/catch.php?rd="www.trackclicks.com/some.php"

then using javascript i will click it from mysite/cach.php.


Solution

  • I was writing an example code, but I found this tutorial that works great for you. You can mask your url changing window.status or handling location.href.