Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We have a multilingual website and the first page redirects to specific language page using 301 redirect based on some logic. For example: redirects to

The problem is that these redirects destroy the primary request so we do not get correct results for traffic sources in GA.

How do you handle this case? Is there something that we can do? Any ideas will be appreciated

share|improve this question
A 301 Redirect is a permanent redirect. It sounds like you are doing redirects to different pages based off of location for the IP. That could cause issues for Google's bot, like it will think your homepage is and not – RandomBen Sep 9 '10 at 17:13
We use cookies not Geo IP and also we have links to all the language versions so the bot can index all pages. But yes you are right that this may confuse the spider. – Ilian Iliev Sep 10 '10 at 6:56
The problem actually was that the referring site uses https and according to RFC2616( "Clients SHOULD NOT include a Referer header field in a (non-secure) HTTP request if the referring page was transferred with a secure protocol." – Ilian Iliev Sep 13 '10 at 9:13
The solutions for the real problem(the HTTPS referrer) can be seen here -> – Ilian Iliev Sep 17 '10 at 6:27

2 Answers 2

up vote 2 down vote accepted

Everything I can find suggests that the HTTP referrer is preserved through a 301 redirect. EDIT: Tested this in Internet Explorer 8, Firefox, Chrome and Opera and they all pass the original referrer through a 301 redirect.

However if you're sure that's not happening in your case, it appears you may be able to (unofficially) override the referrer in GA manually. So when the user visits you could for example set a cookie with the value of the REFERER header, then on pass that to GA.

share|improve this answer
thanks I give it little more investigation/testing – Ilian Iliev Sep 10 '10 at 6:58

I've just finished testing Chrome, IE, and Firefox and I have found that across the board, none of them preserve the HTTP_REFERER string in the case of a 301 redirect.

I also tested when clicking on a LINK from one domain to another and again, across the board, ALL OF THEM preserved the HTTP_REFERER string correctly.

Is this new standard behavior for all of the browsers? Can anyone else confirm that they are experiencing the same behavior?

Here is what I did to test: On in the .htaccess file:

RewriteEngine On
RewriteRule .* [R=301,L]

On in the .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^$
RewriteRule .* [R=301,L]

Then I visited and watched what happened. I cleared the local cache for each of the browsers after updating the .htaccess files to test.

I then commented out the RewriteRule in the .htaccess file on the domain and added a regular link pointing to in the root index.html file for

In each case when I clicked on the link on I got redirected to after being directed to

In each case when I visited WITH THE 301 REDIRECTION ENABLED, I got automatically redirected to, but then I did NOT get redirected to

If a few of you guys could duplicate this test (or whatever method you'd like to use) and let us know if you're seeing the same behavior that would be awesome.

I did this with being the hosting provider. I'm curious to see if somehow this is hosting specific (apache or IIS configuration related).


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.