Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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?

share|improve this answer
<script language="javascript" type="text/javascript">
// <![CDATA[
    function Partners_onclick() {

// ]]>
share|improve this answer
window.navigate() is IE-only. You need window.location.href = 'page2.html'; – w3dk 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.