How to mask referral URLs in address bar

Sweepster picture Sweepster · Jan 13, 2013 · Viewed 8.8k times · Source

Let's say I have a referral URL http://www.example.com/r?ref=86745348 and I want to completely hide the r?ref=86745348 part of the URL from my visitors.

I've tried this approach:

<?php
header("Location: http://www.example.com/r?ref=86745348");
exit;
?>

and I've tried url shortners like TinyURL.

All my attempts hide the URL in the hyperlink, but do not hide the URL in the address bar in the user's browser.

No matter what I do, once the user lands on the referral page, they can see the referral link, delete it, and cheat me out of my referral.

So my question is, how can I hide the referral link from the address bar?

Answer

user149341 picture user149341 · Jan 13, 2013

You can't.

If your business plan depends on tricking users into not realizing that you are taking a referral fee, you need to step back and reevaluate what you're doing.