Redirect script that blanks referrer?


Is it possible to use a re-direct script to blank the referral domain? I’ve heard of things like this but haven’t actually seen it done.

Can you elaborate some more. It just passed out of my head.

Yes, I’m just looking for a php script that will send the visitor to another page but remove any referral details.

I think your problem is incomplete.
If you meant just redirection then are many ways:
PHP: header(‘Location: redirect_url.php’);
HTML: <meta http-equiv=“refresh” content=“0;url=redirect_url.php” />
Javascript: window.location=‘redirect_url.php’

This is not possible without FireFox’s Spoof plugin :slight_smile:

Currently, that’ a property of the browser. Eg. a user can configure her browser to not send the referrer along. Some cutting edge browsers has a property that allows you to control it for the user, but it’s not widely supported:

I’ve heard that some javascript trick can do the thing
Anyway there is noway with PHP. Because - it is very important to understand - it is not PHP who requests another page, but browser.

I believe javascript’s document.location also fills the referer header in the browser, though :wink:

Would be up to the browser in either case as far as I understand things.

@OP, why do you want to do this???

Perhaps to hide where the visit came from, when linking/redirecting to another site? (for what-ever reasons)

Yes precisely. It doesn’t have to be in PHP, but adding javascript code to the page could complicate things a great deal. But if its possible to do that way then it would be worth it.

Do url redirect sites like tinyurl change the redirection site to become the new referrer?

No, if they use a http-redirect, the original site will be in the referrer header.

I think you could serve your site through https. I’m pretty sure that the origin will be hidden when going from http to http. I’m not entirely sure though, so you should probably double check that it works.