A
A
akoriagin19922014-09-17 11:40:25
PHP
akoriagin1992, 2014-09-17 11:40:25

301 redirect, direct entry. How to save referrer?

There is a 301 redirect from domain A to domain B.
When typing domain A by hand in the browser - in the metrics of site B, we see the entry as a direct one. That is, domain A is ignored.
1. How to make a direct entry to domain A redirect to domain B and at the same time save the referrer?
2. If we make the redirect not server-side (301), but client-side (JS or meta refresh), won't SEO suffer?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
akoriagin1992, 2014-09-17
@akoriagin1992

Total:
1. 301/302 redirects do not generate a referrer.
2. The easiest way to get the original URL is to pass it as a parameter to the new URL:
RewriteRule ^some-old-url.html$ /NewURL.html?ref=some-old-url [R=301,L]
3. The second way - secretly pass the parameter to the cookie from the user (only the domain for the cookie must be specified):
RewriteRule ^some-old-url.html$ /NewURL.html [R=301,L,cookie=ref:some-old-url.html:aidom .spider]
4. In the metric, it's easy to see the URL params in the Content report. But even cooler is to set the "visit parameter".

M
Maxim Sergeev, 2014-09-17
@Doppler_ua

If we make the redirect not server-side (301), but client-side (JS or meta refresh), won't SEO suffer?

Won't suffer unless it's weight transfer glue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question