# How to redirect keeping the referral without server-side redirects?

I have an HTML page hosted in Dropbox that some external websites link to. I want to redirect to a different page using only HTML or Javascript, since I can't use any server-side redirects.

My goal is to be able to keep the original referral information for analytics. I've tried different ways but they all end up showing up with no referral.

So if a blog that I have no control over (B) links to my public static page on Dropbox (D), and I want a redirect to the new page hosted elsewhere (N), I would like for the analytics for N to be shown as B, not D.

Is that even possible?

-

A JavaScript redirect would ordinarily pass the HTTP Referer, providing the client is set to do so - but this will contain the URL of your JavaScript/Dropbox page, not the original referer.

BUT... Dropbox is probably using HTTPS. If you are redirecting to vanilla HTTP (non-HTTPS) then the browser will not set the HTTP referer header in these circumstances. See: RFC 2616 - Section 15.1.3

In order to at least pass the information contained in the original HTTP referer, you could perhaps pass this as part of the query string? If you are able to extract this in your analytics?

-
<script language="javascript" type="text/javascript">
// <![CDATA[
function Partners_onclick() {
window.navigate("page2.html");
}

// ]]>
</script

-
window.navigate() is IE-only. You need window.location.href = 'page2.html'; –  w3d Jul 10 '14 at 14:03
window.location.href does not preserve the referrer. –  Stephen Ostermiller Jul 11 '14 at 0:23

I'm not so sure if that could work, but you could try to manually (e.g. with JavaScript) submit the pageview to the N analytics account from the Dropbox Page, then you can do your redirect. Which probably means that you will have two pageviews for the same source but at least you will know the ones that came from the blog.

-